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!

Parmeter formula for looking up date range in table

Status
Not open for further replies.

SUEF

IS-IT--Management
Mar 16, 2005
2
US
I have an accounting period table that has the year and then a date range for each period. The format of the table is yyyymmdd for the dates. I would like to query the table and take the currdate find the current year based on the currdate then pull in the date range the currdate is in for my parmeters in my report. Anyone out there know how to write this statement?
 
Hi,
In the data, is the 'date' field an Actual DATE type? ( What database?)

As a seelction formula, if that is a DATE type, then try:
Code:
Year(CurrentDate) = Year({Table.DateField})

If the 'date' is actually a string then try:
Code:
Year(CurrentDate) = Year(Date({Table.DateField},'yyyyMMdd'))


[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thanks so much for your information. The database is iseries db2. The date field is just a number field in yyyymmdd format. I believe you would consider this a table lookup for the year, then lookup the currdate within the ranges in the file. The table has the fields year, date range. I want to select by first the year, then the date range from that record based on the currdate.
 
Hi,
OK, the formulas I posted are a little incomplete (I missed the part about the ranges ) - How is the date range specified - one field with 2 dates or 2 fields?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top