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.
Author |
Topic |
mateenmohd
Constraint Violating Yak Guru
297 Posts |
Posted - 2005-08-01 : 07:16:09
|
Hi,User only allow to insert Thursday date in MH1 table.if user wrong insert other date in the tablehow can find the other dates data are insert in the table ?ie select * from mh1where dated not in ('12/23/2004','12/30/2004','1/6/2005','1/12/2005',.................)how can use date function in above query which retrieve data other then Thursay date ?regards.Mateen |
|
Seventhnight
Master Smack Fu Yak Hacker
2878 Posts |
Posted - 2005-08-01 : 07:25:02
|
If sunday is 1, then thursday is 5:soSelect * From mh1 Where datepart(dw,dated)<>5CoreyCo-worker on The Wizard of Oz "...those three midgets that came out and danced, the freaked me out when I was little. But they are ok now." |
|
|
mateenmohd
Constraint Violating Yak Guru
297 Posts |
Posted - 2005-08-01 : 07:42:51
|
Thanks for response.for current year it is ok.we have also 2004 thursday date in the table.it should not retrieve year 2004 thursdate date how ?regards.Mateen |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-01 : 07:48:16
|
Select * From mh1 Where datepart(dw,dated)<>5 and year(dated)<>2004MadhivananFailing to plan is Planning to fail |
|
|
mateenmohd
Constraint Violating Yak Guru
297 Posts |
Posted - 2005-08-01 : 08:31:05
|
ThanksMateen |
|
|
|
|
|