rony_78 Posted September 11, 2015 Share Posted September 11, 2015 I am trying to filter a table between two dates in ms access from vb.net . the query below does Not work when data type is date/ time . When I change data type to text, it gives me sum of the columns. Is there anyway to fix it? Thanks select * into Table3 from (SELECT 'Table6' AS [Table], SUM(a) - SUM( AS Result FROM table6 where date_ BETWEEN " & FromDate & " AND " & ToDate & " UNION ALL SELECT 'Table7', SUM(a) - SUM( FROM table7 where date_ BETWEEN " & FromDate & " AND " & ToDate & ")a" Link to comment Share on other sites More sharing options...
justsomeguy Posted September 11, 2015 Share Posted September 11, 2015 With Access you need to use # to enclose literal dates in a query, there are some examples here:https://support.office.com/en-ca/article/Examples-of-using-dates-as-criteria-in-Access-queries-aea83b3b-46eb-43dd-8689-5fc961f21762 Link to comment Share on other sites More sharing options...
rony_78 Posted September 12, 2015 Author Share Posted September 12, 2015 Thank you for the link Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now