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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-06-23 : 10:12:34
|
| mohammed writes "ihave table named united contain curancy price iwant to make select statment like belowselect * from table1 where Tdate =GETDATE()to get the price for curent date but i dont get any record in the result although im fill the table with the curent date regard" |
|
|
jharwood
Starting Member
41 Posts |
Posted - 2004-06-23 : 10:16:55
|
| try select * from table1 where Tdate = convert(char(10),getdate(),101) |
 |
|
|
drymchaser
Aged Yak Warrior
552 Posts |
Posted - 2004-06-23 : 11:10:50
|
select * from table1 where DATEDIFF(dd, Tdate, getdate()) = 0quote: select * from table1 where Tdate = convert(char(10),getdate(),101)
won't work if Tdate has a time element |
 |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2004-06-23 : 11:50:57
|
| [code]select * from table1 where dateadd(dd,datediff(dd,0,Tdate),0) = dateadd(dd,datediff(dd,0,getdate()),0)[/code] |
 |
|
|
|
|
|
|
|