Hi,
I have the below where clause to return data from a date range.
WHERE ((LEFT(tbl_Triage.TIMESTAMP, 10) >=[Forms]![frm_SearchTransactions]![txtDateFrom]) OR ([Forms]![frm_SearchTransactions]![txtDateFrom] Is Null))
AND ((LEFT(tbl_Triage.TIMESTAMP, 10) <=[Forms]![frm_SearchTransactions]![txtDateTo]) OR ([Forms]![frm_SearchTransactions]![txtDateTo] Is Null))
The reason for the use of LEFT is that the TIMESTAMP format is 'dd/mm/yyyy hh:mm' whereas the txtDateFrom and txtDateTo format is 'dd/mm/yyyy'.
The issue I have is that when I search a range from e.g. 16/02/2021 to 23/02/2021 it returns the 16th to 23rd of every month not just February.
Any suggestions as to what is causing this or how I can rectify it would be greatly appreciated. I'm guessing but is it something to do with the LEFT function not recognising special characters?
I have the below where clause to return data from a date range.
WHERE ((LEFT(tbl_Triage.TIMESTAMP, 10) >=[Forms]![frm_SearchTransactions]![txtDateFrom]) OR ([Forms]![frm_SearchTransactions]![txtDateFrom] Is Null))
AND ((LEFT(tbl_Triage.TIMESTAMP, 10) <=[Forms]![frm_SearchTransactions]![txtDateTo]) OR ([Forms]![frm_SearchTransactions]![txtDateTo] Is Null))
The reason for the use of LEFT is that the TIMESTAMP format is 'dd/mm/yyyy hh:mm' whereas the txtDateFrom and txtDateTo format is 'dd/mm/yyyy'.
The issue I have is that when I search a range from e.g. 16/02/2021 to 23/02/2021 it returns the 16th to 23rd of every month not just February.
Any suggestions as to what is causing this or how I can rectify it would be greatly appreciated. I'm guessing but is it something to do with the LEFT function not recognising special characters?