Viewing 11 posts - 1 through 11 (of 11 total)
Here are some samples:
12/31/2006
1/1/2007
12/27/2006
12/3/2007
The code above pulls back all the records because the data is currently nvarchar(12) and not datime
July 2, 2008 at 2:04 am
Yes that was the case, I did not know it was the default setting, many thanks:)
May 27, 2008 at 1:20 am
Many thanks for your help
I need a good Transact SQL book 🙂
May 1, 2008 at 8:15 am
ah I shifted the if statement inside the begin clause and it accepts it
April 7, 2008 at 4:18 am
I get an error "incorrect syntax near keyword 'if'.
alter procedure sp_list_orcon_cat_b_v2
@start_date nvarchar(19),
@end_date nvarchar(19),
@priority nvarchar(1),
@response integer
if @end_date is null set @end_date = @start_date
as
begin
SELECT TOP 100 PERCENT id, report_date, priority_text,
MIN(DATEDIFF(mi,...
April 7, 2008 at 4:09 am
Trader Sam (4/4/2008)
It isn't a problem for small datasets, but can be for...
April 4, 2008 at 8:56 am
Trader Sam (4/3/2008)
This is why many people use...
where somedate >= '04/01/2008' --target date
and somedate < '04/02/2008' --target date + 1
to get all...
April 4, 2008 at 1:42 am
Trader Sam (4/2/2008)
bill.humphrey (4/2/2008)
set @start_date = '24/07/2007 00:00:00'
I don't believe you need to add the time when setting your start_date, as that is implied...
'24/07/2007 00:00:00' = '24/07/2007' (when datatyped...
April 2, 2008 at 8:41 am
Ye got it working at last, although it was displaying dd/mm/yyyy as mentioned I still needed to include 00:00:00 but because there was no record for '24/07/2007 00:00:00' I needed...
April 2, 2008 at 8:22 am
I'm pulling a sample date from the dataset when the date parameter is not set so I know the record should qualify the criteria
Kind Regards
Bill Humphrey
April 2, 2008 at 5:54 am
OK I tried it but it still returns a blank row and the record exists in the data returned when I don't use the date parameter. I'm using SQL...
April 2, 2008 at 5:51 am
Viewing 11 posts - 1 through 11 (of 11 total)