Greetings all,
I am really at a loss here, seemed like it should be simple, but up against a brick wall.
Running a SQL stored procedure (SQL 2000)with several unions for a Crystal Report. Due to the large amount of data in the database, I am filtering the info in each union with an IN statement to reduce the data which is displayed to Crystal, like this
Where JOb# in
(select JOB# from Header Table
where header.jobdate >= @startparameter
and header.Jobdate >= @endparm
from header)
This only brings over jobs related to the various other tables which fit in the range. Each table used in the union can have many records for the same job.
The parameters are char(10), and are passing fine from Crystal. Issue is with the time field in the Job date (it is a date time field) when the app assigns a job date, it also assigns a time, which is causing a problem when you run the report for the end date. The passed parameter information comes over as 01/10/2009 (working fine!) except for that darn time portion in the SQL data, it excludes all jobs from the end parameter for the date (01/15/2009 for example won't show, as it is got a time which is making it greater that the cutoff). I tried several cast, converts and datediffs, but am having no luck with this one. Maybe been looking too long at it, but hope someone has an idea as to how to get the datetime to not see the time, but still read the 10 character parameter being passed from Crystal. I would much prefer to NOT use a datetime in CR, due to the end users skill levels.
Many thanks in advance.
I am really at a loss here, seemed like it should be simple, but up against a brick wall.
Running a SQL stored procedure (SQL 2000)with several unions for a Crystal Report. Due to the large amount of data in the database, I am filtering the info in each union with an IN statement to reduce the data which is displayed to Crystal, like this
Where JOb# in
(select JOB# from Header Table
where header.jobdate >= @startparameter
and header.Jobdate >= @endparm
from header)
This only brings over jobs related to the various other tables which fit in the range. Each table used in the union can have many records for the same job.
The parameters are char(10), and are passing fine from Crystal. Issue is with the time field in the Job date (it is a date time field) when the app assigns a job date, it also assigns a time, which is causing a problem when you run the report for the end date. The passed parameter information comes over as 01/10/2009 (working fine!) except for that darn time portion in the SQL data, it excludes all jobs from the end parameter for the date (01/15/2009 for example won't show, as it is got a time which is making it greater that the cutoff). I tried several cast, converts and datediffs, but am having no luck with this one. Maybe been looking too long at it, but hope someone has an idea as to how to get the datetime to not see the time, but still read the 10 character parameter being passed from Crystal. I would much prefer to NOT use a datetime in CR, due to the end users skill levels.
Many thanks in advance.