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

Daily Report 1

Status
Not open for further replies.

Baixinha

Programmer
Dec 27, 2000
122
0
0
BR
I need to creat a report where only the records of the day going to be printed, but when I put the function, the program take the hour of system insted of date.


I need some help and Excuses because my english. I'm brazilian.


Thanks


Cintia
 
What formula are you using, which function are you using to call the date?
 
I'm using

{Cadastro.Data} in ["CurrentDate"]
 
This formula,

{Cadastro.Data} = CurrentDate

Generate a error

A string is required here. (in front of CurrentDate)

 
That means that your field isn't a date field. Right click on the field in your report and select "Browse field data" to confirm the data type of this field as reaad by CR.

Also post a sample value as it prints on the report in it's exact format.
Last, give us the version of CR you are using. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
The data format that CR is using is dd/mm/yy (format required in Brazil), but the error is the same.

I'm using Crystal Reports 8

thanks
 
You gave me the format and CR Version, but you didn't tell me the data type of the field. See the first line of my last post and tell me what data type CR is seeing. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
The problem is that CurrentDate is a date value and you are comparing it to a string field. To make it work you have to convert one to the other, and the easiest is to convert today's date to a string.

Try the following formula for your record selection formula:

Totext(CurrentDate,'dd/MM/yy') = {Cadastro.Data}

You specified a 2 digit year in your sample, so that is what I am using (let me know if you really meant a 4 digit year). The format string in quotes IS case sensitive, so keep it just like I have shown it. Let me know how it works. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
After that, the formula that I've use is:

{Cadastro.Data} = CurrentDate

or there is another one?

If I use this formula, after covert the field, CR ask me to add a string yet.
 
You only need one formula. It is the last one that I gave you.

THis is not a formula field, but the "record selection formula". It does the conversion to a string for you while it is selecting. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
I was using the formula in the wrong way, but now, the report is working correctly.

Thanks Very Much
 
When I print my report, the field where I put the formula is appearing.

How can I omit this field?

Thanks
 
The formula I gave you wasn't supposed to go into a field. However, if it is working I would just delete that field from the canvas leaving it in the formula list. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top