

I am converting old Access DB’s to SQL and writing a CF app. I want to print a report that for shipments per week. How can I query a table with a ship date of 06/04/2019 and return everything that needs to be shipped in that week? The daily WHERE statement is WHERE shipdate = ‘#DateFormat(Now(), “mm/dd/yyyy”)#’
I am converting old Access DB’s to SQL and writing a CF app. I want to print a report that returns shipments per week. How can I query a table with a ship date of 06/04/2019 and return everything that needs to be shipped in that week? The daily WHERE statement is WHERE shipdate = ‘#DateFormat(Now(), “mm/dd/yyyy”)#’
I am converting old Access DB’s to SQL and writing a CF app. I want to print a report that returns shipments per week. How can I query a table with a ship date of 06/04/2019 and return everything that needs to be shipped in that week? The daily WHERE statement is WHERE shipdate = ‘#DateFormat(Now(), “mm/dd/yyyy”)#’

- Most Recent
- Most Relevant
How about
WHERE CONVERT(date, shipdate) BETWEEN DATEADD(ww, -2, getDate()) AND DATEADD(ww, -1, getDate())
You don’t say what your database is, but something like
WHERE shipdate < <cfqueryparam value=”#dateAdd(-1,’w’,now())#” cfsqltype=”datestamp”/>
AND shipdate > <cfqueryparam value=”#dateAdd(-2,’w’,now())#” cfsqltype=”datestamp”/>