Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 SQL Transaq

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-12-06 : 13:11:57
Yoga writes "Dear Team,

I want to select all data from tabel, let say since December 2005 backword. How the SQL Transaq?

regards,"

druer
Constraint Violating Yak Guru

314 Posts

Posted - 2005-12-06 : 14:46:13
select * from table where myDataField < '12/01/05'
Will yield all results up to, but not including December 2005 data

select * from table where myDateField < '01/01/06'
Will yield all results up to and including December 2005 data, but not will not include January 2006 data
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-07 : 01:57:50
>>select * from table where myDataField < '12/01/05'

Better to use universal format to avoid conflict with local settings

select * from table where myDataField < '20051201'


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -