Saturday, September 28, 2013

[T-SQL] compare rows

[T-SQL] compare rows


compare rows

Posted: 27 Sep 2013 11:34 PM PDT

Hi,Please help me to find out conflicts between two records.Scenario: as mentioned below i need to add flag conflict 1 or 0.problem : find studentid's having course more than 1 on a single date and if StartTime of second rows comes between Starttime and Endtime of first row then update conflict flag as 1. I want to compare all rows and find out conflicts. Plase help me how to aschieve this?StudentID Course StartDate StartTime EndTime Conflict1001 Chem 11/4/2013 0:00 7:00 AM 6:00 PM 11001 Phy 11/4/2013 0:00 11:00 AM 2:00 PM 11001 Math 11/4/2013 0:00 8:00 PM 11:00 PM 01001 Bio 11/4/2013 0:00 4:00 AM 7:00 AM 1Thanks,

find date differnce from AM PM format

Posted: 27 Sep 2013 06:31 PM PDT

Hi,I want to find difference between two times which is in AM PM format. Please suggest any idea how to do that?ThanksAbhas

Find difference in time which is AM PM format

Posted: 27 Sep 2013 06:33 PM PDT

Hi,I want to find difference between two times which is in AM PM format. Please suggest any idea how to do that?ThanksAbhas

Is possible create numbered sequences

Posted: 06 Aug 2013 03:18 AM PDT

ROW_ID12233344445555566666677777778888888899999999910101010101010101010111212131313Up to 10000Is possible create numbered sequences like the ROW_ID above, where the row numbers repeat themselves up to 10000 into an empty column? In SQL serverThanks

Error converting data type nvarchar to numeric

Posted: 27 Sep 2013 02:33 AM PDT

Maybe I am a bit dense today since it is a Friday and I am looking towards the weekend.. But this isn't making sense to me.I have a web form with a QTY in it, it has javascript to only allow numbers, but people disable their javascript and enter crazy things in qty fields sometimes..SO... I am writing some code and getting the error. I have simplified it down to this, but still get the error.Doesn't make sense to me since I am using the ISNUMERIC to only apply the CAST function to records that are actually numbers.select case when ISNUMERIC(QtyOrdered)=1 then CAST(QtyOrdered AS decimal(19,6)) else 0.0 end as Qtyfrom ordersAny ideas? Thanks in advance.

No comments:

Post a Comment

Search This Blog