Viewing 15 posts - 3,796 through 3,810 (of 10,144 total)
If you know that DATEADD(s, nDateTime, '1970-01-01 00:00:00') converts seconds since 1970-01-01 to a datetime,
why not simply swap the faulty expression in your WHERE clause for the the expression...
January 6, 2014 at 3:09 am
Jeff Moden (1/4/2014)
sayedkhalid99 (1/3/2014)
DECLARE @Result TABLE...
January 6, 2014 at 2:21 am
cs_source (1/3/2014)
January 3, 2014 at 9:59 am
DECLARE @Result TABLE (Serial nvarchar(10),Title varchar(20))
INSERT INTO @Result
SELECT '1.1','a' UNION ALL
SELECT '1.2.1','b' UNION ALL
SELECT '1.2.2','C' UNION ALL
SELECT '1.2.3.4','G' UNION ALL
SELECT '1.11','B' UNION ALL
SELECT '1.2.33.4.5','Extra row' UNION ALL
SELECT '2.3','B' UNION ALL
SELECT...
January 3, 2014 at 8:45 am
Jeff Moden (1/3/2014)
ChrisM@Work (1/3/2014)
Jeff Moden (1/2/2014)
January 3, 2014 at 8:29 am
;WITH
[4] AS (SELECT n = 0 FROM (VALUES (0), (0), (0), (0)) d (n)),
[16] AS (SELECT n = 0 FROM [4] a, [4] b),
[256] AS (SELECT n = 0...
January 3, 2014 at 8:27 am
cs_source (1/3/2014)
hi Chris.m below is the sample data as well as my expected output (sorry...
January 3, 2014 at 8:01 am
You're welcome, thanks for the feedback 🙂
January 3, 2014 at 7:16 am
cs_source (1/2/2014)
Thank you, this query is very similar to my first query and it works great if the car is in "service/shop" on the same day, the problem i...
January 3, 2014 at 7:11 am
Thanks.
-- try this
SELECT a.EID, a.RATING, a.AbsenceStartDate,
AbsenceEndDate = ISNULL(b.AbsenceEndDate, a.AbsenceEndDate)
FROM @COMP_RATINGS a
LEFT JOIN @COMP_RATINGS b
ON b.EID = a.EID
AND b.RATING = a.RATING
AND b.AbsenceStartDate = a.AbsenceEndDate
WHERE NOT EXISTS (SELECT 1...
January 3, 2014 at 6:42 am
What's the maximum number of elements you can have in a "serial"? Your sample data shows 3, can it be more? There are two good ways of splitting this into...
January 3, 2014 at 6:32 am
Source data
(769,'b+','2011-06-30','2011-09-30'),
Required output
5364914 b+ 2011-09-30 00:00:00.0000000 2011-12-31 00:00:00.0000000
If the required output is incorrect then please correct it.
January 3, 2014 at 6:27 am
Thanks.
Please explain the result for rating = 'b+'.
There's only one row with this value in the sample data, and it's completely different in the required output.
January 3, 2014 at 6:11 am
kbhanu15 (1/3/2014)
THANK YOU FOR YOUR HELP.
THE QUERY IS SATISFYING THE SAMPLE GIVEN DATA.
BUT IT IS NOT SOLVING MY ORIGINAL PROBLEM.
THE ORIGINAL DATA IN THE TABLE:
5364914b+2011-09-30 00:00:00.00000002011-12-31 00:00:00.0000000
5364914bb2011-06-30 00:00:00.00000002011-09-30 00:00:00.0000000
5364914bb2011-12-31...
January 3, 2014 at 5:26 am
Viewing 15 posts - 3,796 through 3,810 (of 10,144 total)