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

to find month in a date 1

Status
Not open for further replies.

PeriyurParthi

IS-IT--Management
Jul 18, 2001
258
IN
dear all
i need formula to find a month in a date. this is to develope birhtday report for employees.iam useing parameter to pass the monthname ,according to that the formula should filter the records. Help will be appreciated.thanks
parthi
 
parthi

You can just simply use the month function. Therefore

month{employee.DOB}

will extract just the month from a date format field.



Lewis
United Kingdom
 
Month({YourDateField}) will return an integer between 1 and 12.

Monthname(month({YourDateField})) will return January, February, etc.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
thanks for your replies. month{employee.DOB} working fine.
i just created a parameter for month as ?mnth and created formula as bday

if month({EmpMaster.DOB})={?month} then {EmpMaster.DOB}
and added the above code in it.
when i excute the form it the remaining values are also exisiting in the report. can you please try to solve my problem.
thanks
parthi
 
Click on report, edit selection formula, record, and enter the formula:

month({EmpMaster.DOB})={?month}

This will restrict your report to only those employees with a birthday in the month in question.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
thanks dgillz . its works fine. thanks a lot for your reply.
parthi
 
Typically this (Month function) will not pass the SQL to the database, but if you generate a SQL Expression (database dependent) which returns the month from the date in question, and use the same syntax as dgillz described, except using the sql expression field, you'll offload the processing to the database and enjoy better performance.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top