Link to home
Start Free TrialLog in
Avatar of dba123
dba123

asked on

AND ((cs.dtDateCreated >= '2007-11-07 00:00:00.000' AND cs.dtDateCreated <= '2008-01-15 00:00:00.000' + 1)

I assume I need to cast?

AND ((cs.DateCreated >= '2007-11-07 00:00:00.000' AND cs.DateCreated <= '2008-01-15 00:00:00.000' + 1)
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dba123
dba123

ASKER

thank you.
Avatar of dba123

ASKER

got it to work this way as well
AND ((cs.DateCreated >= CAST('2007-11-07 00:00:00.000' as varchar) AND cs.DateCreated <= CAST('2008-01-15 00:00:00.000' AS varchar))
>got it to work this way as well
this might work, but it is using implicit conversion format.
you should prefer the explicit way I suggested, it will save you from unexpected trouble you could get into later... on other servers ... etc...