Hello Everyone,
I'm using SQL to get data from Access to my Excel Sheet, but I want to use the invoice date to have another filter criteria,
Do you know how can it be done?
I'm trying to convert the Invoice Date with:
" TO_CHAR(`Invoice Date`, 'YYYYMMDD')," & _
and then use BETWEEN in my Query,
however, it's giving me error.
¿is there any other way to get it?
This is my original Code that is Working,
But I cannot make it work with BETWEEN operator.
Any idea?
I'm using SQL to get data from Access to my Excel Sheet, but I want to use the invoice date to have another filter criteria,
Do you know how can it be done?
I'm trying to convert the Invoice Date with:
" TO_CHAR(`Invoice Date`, 'YYYYMMDD')," & _
and then use BETWEEN in my Query,
however, it's giving me error.
¿is there any other way to get it?
This is my original Code that is Working,
But I cannot make it work with BETWEEN operator.
Any idea?
Code:
SQL0 = " SELECT " & _
" Mat," & _
" `Vol`," & _
" Mon," & _
" `Invoice Date`," & _
" `Group`," & _
" Dest," & _
" source," & _
" Sales"
SQL7 = " FROM `C:\Sales\NSalesAc.accdb`.NSales" & _
" WHERE `Group` = '" & MODL & "' " & _
" AND Dest = '" & MKT & "' "
SQL = SQL0 + SQL7