Viewing 15 posts - 1,966 through 1,980 (of 2,006 total)
Don't understand how what you've currently got works.
But this does what you want I think: -
DECLARE @Table TABLE(
id INT,
[Time] DATETIME)
INSERT INTO @Table
VALUES...
May 26, 2010 at 4:08 am
Does logic from the last response not point this out to you? I'm guessing: -
) + ' )'
May 26, 2010 at 3:27 am
I got this right by process of elimination. . . I thought it'd fail so decided to go with "it depends" :hehe:
If "error" had been an option, I'd have got...
May 25, 2010 at 2:44 am
Ah! Now I understand what you wanted! :hehe:
DECLARE @isLockOutPeriod BIT
SET @isLockOutPeriod = CASE
...
May 19, 2010 at 8:45 am
DECLARE @theDate VARCHAR(50)
DECLARE @startDate VARCHAR(50)
DECLARE @endDate VARCHAR(50)
DECLARE @month VARCHAR(15)
DECLARE @day INTEGER
DECLARE @year INTEGER
--Get the current date
SET @theDate=getDate()
--Set the month, day and year for the start
SET @month='January'
SET @day='1'
SET @year='2009'
--Set the startdate
SET...
May 19, 2010 at 8:22 am
Not sure I fully understand your requirement.
Are we trying to grab the year of the previous quarter? If so: -
SELECT CASE
...
May 19, 2010 at 8:15 am
Assuming I've understood you. . . this should be OK.
DECLARE @theDate VARCHAR(50)
DECLARE @startDate VARCHAR(50)
DECLARE @endDate VARCHAR(50)
SET @theDate='1 jan 2010'
SET @startDate='31 dec 2007'
SET @endDate='1 jan 2009'
SELECT CASE
...
May 19, 2010 at 8:03 am
Since this is a SQL forum. . . how about you post what the code is meant to do rather than just posting code. That way someone might decide to...
May 19, 2010 at 7:39 am
There will be a much better way of doing this than how I've done it. . . but this works
SELECT CASE
WHEN...
May 19, 2010 at 7:33 am
Ummm, the code you were given does what you asked for.
(cleaned up below)
--Create test data
DECLARE @CurDate VARCHAR(25)
SET @CurDate='1 jan 2010'
DECLARE @QuarterDefinition TABLE(
quarterid ...
May 19, 2010 at 6:31 am
--EDIT-- The more I look at your code, the more it looks right. Just tested it on my server and got the expected answer. So I suspect, the error...
May 17, 2010 at 8:16 am
Just so I understand. . . run this and tell me if it gives you the result you'd expect.
DECLARE @testtable1 TABLE(
id ...
May 17, 2010 at 8:08 am
I'll just show the timesheets off. . . took me two days to work through all of the changes last time and that was a smaller project than this one.
May 12, 2010 at 10:06 am
Viewing 15 posts - 1,966 through 1,980 (of 2,006 total)