Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select between
Message
 
 
To
25/07/2006 04:55:12
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01139595
Message ID:
01139612
Views:
10
>I have a problem with select records from table.
>There are one record in table mydb.dbo.R_mytable with datetime field
>mydatetime={25.07.2006 12:27}
>
>But SQL-command:
>select * from mydb.dbo.R_mytable where mydatetime between
>convert(datetime,'05.07.2006',104) and convert(datetime,'25.07.2006',104)
>
>not find records.
>
select * from mydb.dbo.R_mytable 
where mydatetime >= DATEADD(dd, DATEDIFF(dd, dt, '05.07.2006'), dt)
  AND mydatetime < DATEADD(dd, DATEDIFF(dd, dt, '05.07.2006'), dt)+1
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform