Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Date in CR XI

Status
Not open for further replies.

celauritz

Technical User
Dec 2, 2005
41
US
If there is a date in the database I'm using, it is broken into four columns for Century, Year, Month and Day. I have been able to write a formula to put this into a date format in Crystal, but I need to write a SELECT statement in SQL to turn the four columns into a readable and usable date for some of the reporting I need to do.

I have no idea how to do this. I'm not sure if I should ask here or in the SQL forum, but I'll start here.
Any help with the statement would be appreciated.

Thanks,
 
You can use the formula in the Select statement. However, as it will not be converted to SQL it will bring back all dates to local machine and do filtering there. This could be very slow to process.

Alternatively you could reverse your formula into for parts.
User enters a date parameter, and then you create four formulae for Century, Year, Month and Day

In select staement, use those formulae to filter corresponding fields in database. Crystal will evaulate formulae and pass as true SQL.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top