February 17, 2010 at 8:40 pm
I am having Different Type of Vouchers Database in Voucher Table
But i need to get a data from_date to to_date this is i applied Query but not Working
Set rS_vou1 = db.OpenRecordset("Select * from Voucher where (Vou_type = '" & "Payment" & "') and Vou_Date >= '" & nDTpicker & "' and vou_date <= '" & oDTpicker & "' ")
February 18, 2010 at 2:05 am
It could be a date format issue. Your code is also prone to sql injection, use prepared statements instead.
Put @parameter placeholders in your sql, then add parameter values to your SqlCommand object.
Anyway, when you ask for help on issues like this, be sure to provide a script for the table and some sample data, in order to get a quicker reply. See this for details on how to post effectively: http://www.sqlservercentral.com/articles/Best+Practices/61537/
Hope this helps
Gianluca
-- Gianluca Sartori
February 19, 2010 at 3:08 am
Thank You
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply