Viewing 15 posts - 1,966 through 1,980 (of 2,006 total)
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
May 18, 2010 at 6:29 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
PaulB-TheOneAndOnly (5/14/2010)
skcadavre (5/14/2010)
All I've been able to do is get two seperate queries
One way to do it reusing your code? How about derived tables? use your two queries as derived...
May 14, 2010 at 6:53 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
Once I've gone over the scripts created, I'll be speaking to the boss about how much time it saved. . . fairly sure that the time saved equals far more...
May 12, 2010 at 8:51 am
Viewing 15 posts - 1,966 through 1,980 (of 2,006 total)