Hello Everyone,
I have a rather deep question
Having a getdate in the where statement to pull data of all files associated with the month of saledate.
Field is dfeSaledate (pulls date of every 1st Tuesday of the month)
Example:
November 18th
Saledate December 3rd (1st Tuesday of the month)
December 18th
saledate is January 7th (1st Tuesday of the month)
Need report to change according to current date and saledate.
How do I create the sql statement or have crystal reports automate this function. At present I would have to go into the where statement of report and change the saledate for each month...
(THIS IS THE GETDATE STATEMENT)
dbo.tblFCTitleEvents.dFTExamReceived > DATEADD(d, - 1, CAST(CAST(DATEPART(month, GETDATE()) AS varchar(20)) + '/' + CAST(DATEPART(day,
GETDATE()) AS varchar(2)) + '/' + CAST(DATEPART(year, GETDATE()) AS varchar(4)) + CAST('16:00:00.000' AS datetime) AS datetime))) AND
(dbo.tblFCTitleEvents.dFTExamReceived < CAST(CAST(DATEPART(month, GETDATE()) AS varchar(20)) + '/' + CAST(DATEPART(day, GETDATE())
AS varchar(2)) + '/' + CAST(DATEPART(year, GETDATE()) AS varchar(4)) + CAST('16:00:00.000' AS datetime) AS datetime))
where tblFCEventdates.dfeSaleDate = '01/07/03'
Hopefully I have made some sense of what I am trying to say...
Thank you all
I have a rather deep question
Having a getdate in the where statement to pull data of all files associated with the month of saledate.
Field is dfeSaledate (pulls date of every 1st Tuesday of the month)
Example:
November 18th
Saledate December 3rd (1st Tuesday of the month)
December 18th
saledate is January 7th (1st Tuesday of the month)
Need report to change according to current date and saledate.
How do I create the sql statement or have crystal reports automate this function. At present I would have to go into the where statement of report and change the saledate for each month...
(THIS IS THE GETDATE STATEMENT)
dbo.tblFCTitleEvents.dFTExamReceived > DATEADD(d, - 1, CAST(CAST(DATEPART(month, GETDATE()) AS varchar(20)) + '/' + CAST(DATEPART(day,
GETDATE()) AS varchar(2)) + '/' + CAST(DATEPART(year, GETDATE()) AS varchar(4)) + CAST('16:00:00.000' AS datetime) AS datetime))) AND
(dbo.tblFCTitleEvents.dFTExamReceived < CAST(CAST(DATEPART(month, GETDATE()) AS varchar(20)) + '/' + CAST(DATEPART(day, GETDATE())
AS varchar(2)) + '/' + CAST(DATEPART(year, GETDATE()) AS varchar(4)) + CAST('16:00:00.000' AS datetime) AS datetime))
where tblFCEventdates.dfeSaleDate = '01/07/03'
Hopefully I have made some sense of what I am trying to say...
Thank you all