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

DON´T RECOGNIZE THE FIELD DATE

Status
Not open for further replies.

mafercita

Technical User
Jan 16, 2006
9
MX
PLEASE HELP ME I DON´T KNOW WHAT IS THE MISTAKE?
WhileReadingRecords;
dateVar Birth :={Empleados.FechaNacimiento};// Replace this with your field for Date Of Birth
DateVar Ann := CurrentDate; // Replace this with CurrentDate to get their age as of the time of the report
//or the date field of an event to get their age as of the time of that event.
if (Month(Ann) * 100) + Day (Ann) >=(Month(Birth) *100) + Day (Birth)
then Year (Ann) - Year(Birth)
else Year (Ann) - Year(Birth) -1
WHEN READS THE DATE EMPLEADOS.FECHANACIMIENTO THE PROGRAM TELL ME THAT HERE NEEDS A DATE..BUT IS STRANGE BECAUSE THIS FIELDS WAS DECLARATED AS A DATE FIELD..PLEASE HELP ME I DON´T KNOW WHAT TO DO.
 
What happens if you change the formula line to the following?

dateVar Birth :=cdate({Empleados.FechaNacimiento});

-LB
 
True, the variable was declared to accept a date, but the field that you are placing in to serve as the date is not a date type.

You need to convert your database field to a date type, right click it and select browse data to learn it's type.

Then use something like the MID() function to convert it (if it's a string, might be numeric.

Post technical information, aside from the language barrier, we need to know what software, database and what the data is you're working with to provide answers.

You alos migh twant ot get a schema for your database so that you know what data types you're working with rather than guessing.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top