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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Function

Status
Not open for further replies.

nanctalk

MIS
Oct 20, 2000
1
US
I am new to Crystal SeaGate Software and I'm trying to compare a date in my database to today's date and if it's less then return those records. However, I cannot seem to determine how to set this up in the Formula Text field properly. I tried the various data functions but they all want a value. How would I compare a date field to today's date and have it return the record set that meets the criteria?
 
If you have the date field defined as datetime then the compare is going to include the time as well as the date. this can cause you problems. If you are doing the date compare in an SQL stored procedure this can really get you, try this code in SQL for your end date:

select @EndDate = dateadd(hh,23,dateadd(mi,59,dateadd(ss,59,@EndDate)))

If I didn't make any sense it's because it is Friday. [sig][/sig]
 
I didn't answer your question, stupid me!

While in crystal design click report|Edit Selection Formula|Record

then enter the following formula

{qfr_G100;1.ExamD} < CurrentDate

the {qfr_G100'1.ExamD} is a field passed to my report via an SQL stored procedure, substitute you field name. this will pass only the records that meet this compare to your report. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top