Viewing 15 posts - 4,846 through 4,860 (of 6,400 total)
Could you not use the generate scripts function in ssms.
It's somewhere on the database when you right click it, can also get it to script out the data and should...
May 29, 2012 at 12:39 am
Just use due date > getdate() and due date <= the first expression in my last post
May 28, 2012 at 10:17 am
--To get 23:59:59 of the current day
SELECT CONVERT(DATETIME,LEFT(CONVERT(NVARCHAR,GETDATE(),120),10)+' 23:59:59.997')
--To get 00:00:00 of the next day
SELECT CONVERT(DATETIME,LEFT(CONVERT(NVARCHAR,GETDATE()+1,120),10)+' 00:00:00.000')
--To get 23:59:59 of the next day
SELECT CONVERT(DATETIME,LEFT(CONVERT(NVARCHAR,GETDATE()+1,120),10)+' 23:59:59.997')
That will do what you need,...
May 28, 2012 at 8:57 am
Sachin 80451 (5/28/2012)
It give me this error:Msg 243, Level 16, State 1, Line 1
Type DATE is not a defined system type.
DOH, my bad, forgot I was in the 2005 Forum,...
May 28, 2012 at 8:51 am
Why do you need to change from DATE to DATETIME?
May 28, 2012 at 8:44 am
SQLDBA360 (5/28/2012)
anthony.green (5/25/2012)
crookj (5/25/2012)
anthony.green (5/25/2012)
Ray K (5/25/2012)
SQLRNNR (5/24/2012)
crookj (5/24/2012)
Daniel Bowlin (5/24/2012)
anthony.green (5/24/2012)
Ray K (5/24/2012)
SQLRNNR (5/23/2012)
Revenant (5/23/2012)
tigerSurvivor
Foreigner
asylum
records
I Want to Know What Love Is
Shakespeare's Sister
Whistler's Mother
Mr Bean
Mr Bill
Bill and Ben the flower...
May 28, 2012 at 8:40 am
cursors have their place when you need to do RBAR but if you can go for set based executions.
now depending on what your cursor is doing will depend on if...
May 28, 2012 at 8:28 am
Ok, lets start again
For the current day you want
DueDate > GETDATE() AND DueDate < CONVERT(DATE,DATEADD(DAY,1,GETDATE())) --DueDate > '2012-05-28 15:12:00.000' AND DueDate < '2012-05-29'
For tomorrow (if you just want...
May 28, 2012 at 8:18 am
yes, like Andy said, you need to add in a row_number clause to your select, wrap it all in a cte, then have 2 variables, set 1 as the lower...
May 28, 2012 at 8:10 am
It all depends on what your doing with the processing and if the whole table needs to be processed at the same time or if they can be processed in...
May 28, 2012 at 8:01 am
Sachin 80451 (5/28/2012)
Yes fantastic that works. I did only want records for that day and after current time.what would the logic be for tomorrow?
or this week?
For tomorrow
To see...
May 28, 2012 at 7:47 am
Sachin 80451 (5/28/2012)
This also returns records with the following due date 29/5/2012 00:00:000?
Can you post us some more sample data with varing dates, then give us a date and time...
May 28, 2012 at 7:38 am
declare a variable and set it to the variable + @@rowcount on each itteration
declare @rc bigint = 0
May 28, 2012 at 7:21 am
Sachin 80451 (5/28/2012)
I want to get todays records. Past the current...
May 28, 2012 at 7:19 am
Yeah, I'm out of the books now, everything is away, only thing i can see on my desk is my flash cards, but as I have spend all morning crossing...
May 28, 2012 at 7:06 am
Viewing 15 posts - 4,846 through 4,860 (of 6,400 total)