sathyaganapathi
Board Regular
- Joined
- Apr 29, 2021
- Messages
- 81
- Office Version
- 2016
- Platform
- Windows
I have a access table and one column contains week numbers as yyww (ex. 2133, 2134, 2135 etc..). I want to write a excel vba query to get the table data between two numbers in specific column (for example - 2133 and 2135). Please help with VBA code.
the query I used is as below. But I do not get the data
If I use below code, I get all data in table.
how to add the week number to the query? please help.
the query I used is as below. But I do not get the data
VBA Code:
SWeek = SWeek.value
EWeek = EWeek.value
qry = "SELECT * FROM [Countdeptbyweek] WHERE [Department] is not null order by [Month], [Week], [CountOfReason] AND [Week] BETWEEN SWeek AND EWeek"
If I use below code, I get all data in table.
Code:
qry = "SELECT * FROM [Countdeptbyweek] WHERE [Department] is not null order by [Month], [Week], [CountOfReason]"
how to add the week number to the query? please help.