Retrieveing order date from table
Hi friend, select * from trans_sales_entry where orderdate=2008-07-01 00:00:00.000 this date I copied it from result set when i did't mention where clause.when I pick that and mentioned in the where clause, it is showing nothing but there is a record on this date. how to get my record Thank you.
October 23rd, 2011 6:59am

Hello, Not sure I understand so this may not be the right answer: You need single quotes around the date = '2008-07-01 00:00:00.000' If the data does actually have the time of day in it, the where clause will not match. You will need to convert orderdate to DATE rather than datetime (if it isnt already) It could also be the difference between American dates and UK dates - perhaps set the dateformat before hand? Example: SELECT * FROM trans_sales_entry WHERE CAST(orderdate AS DATE) = '2008-07-01' I think that's the answer!
Free Windows Admin Tool Kit Click here and download it now
October 23rd, 2011 7:15am

can you be more eloborate on your Problem ? you might need to write a Query like select * from trans_sales_entry where orderdate='2008-07-01 00:00:00.000'Rakesh M J Dont forget to mark it as Answered if found useful MCTS,MCITP,MCSS http://myspeakonbi.blogspot.com/
October 23rd, 2011 7:18am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics