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 |
arvindbkushwaha
Starting Member
2 Posts |
Posted - 2011-08-22 : 02:40:44
|
I have a table with lastupdated column where data is stored with date and time ..I want to retrieve the data based on date only..but database contain time also..I cannot modify the column..How should i write a sql query to retrieve the data based on date only not with time if database contain data along with time.. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-08-22 : 02:45:59
|
In sql server it will be something likeWHERE lastupdated >= <your date value without time> AND lastupdated < <your date value without time> + 1 Not much sure on mysql. this is a sql server forum and solutions given here are mostly sql server specific. In case above doent work please try you luck in some mysql forums likehttp://www.dbforums.com/mysql/------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
arvindbkushwaha
Starting Member
2 Posts |
Posted - 2011-08-22 : 03:47:57
|
can u provide some query example in details.. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-08-22 : 04:30:47
|
for example if you want all records from table which got updated today the query should be likeSELECT columns...FROM tableWHERE lastupdated >= '20110822'AND lastupdated < '20110823' ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|