September 13, 2011 at 6:39 am
Dear All,
select opening_bal,authorised_date from t_period_value_balance
where group_no ='CENVAT' and
duty_type= 'BED' and
register_type ='RG23A' and
authorised_date <='2011-05-31'
order by authorised_date
Execution of this code does not retrive the below row
opening_bal authorised_date
17763123.00000000 2011-05-31 22:51:21.367
What to do with the authorised_date coloumn to retrive the above row ??
I'm working in SQL 2005 Standard Edition.
September 13, 2011 at 6:43 am
change authorised_date <='2011-05-31' to authorised_date <'2011-06-01'
September 13, 2011 at 6:49 am
Thanks for instant reply.
That is one I have in mind.
September 13, 2011 at 6:53 am
If you don't supply a time, it defaults to midnight (00:00:00.000). So the datetime that your comparing to is '2011-05-31 00:00:00.000' which is less than the datetime on the record that's not being pulled. That's why it's not working. If this is a variable, you can use the DateAdd() function to add one day to the selected date.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 13, 2011 at 11:41 pm
drew.allen (9/13/2011)
If you don't supply a time, it defaults to midnight (00:00:00.000). So the datetime that your comparing to is '2011-05-31 00:00:00.000' which is less than the datetime on the record that's not being pulled. That's why it's not working. If this is a variable, you can use the DateAdd() function to add one day to the selected date.Drew
Thanks for reply.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply