Hello,
I am running a SQL query that grabs information from the previous month. For example, on August 1, I plan to run this query to get information I need for the month of July.
"WHERE (((act_task.billable_time) Is Not Null Or (act_task.billable_time)>0) AND ((act_task.status_dt) Between
dateadd(month, -1, getdate()) + '-01' And dateadd(day, -1, getdate())))"
This is the where clause that I am using and I'm using a between function to get the first day of the previous month and the last day of the previous month. This where clause is giving me a lot of datetime errors. I want to convert this datetime into a string to satisfy the between function. Please help! Thank you.
I am running a SQL query that grabs information from the previous month. For example, on August 1, I plan to run this query to get information I need for the month of July.
"WHERE (((act_task.billable_time) Is Not Null Or (act_task.billable_time)>0) AND ((act_task.status_dt) Between
dateadd(month, -1, getdate()) + '-01' And dateadd(day, -1, getdate())))"
This is the where clause that I am using and I'm using a between function to get the first day of the previous month and the last day of the previous month. This where clause is giving me a lot of datetime errors. I want to convert this datetime into a string to satisfy the between function. Please help! Thank you.