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!

Convert Month name and Year name to integer

Status
Not open for further replies.

sbrunswik

MIS
Jan 13, 2005
14
0
0
US
I am needing some assitance. I need to select the correct record from one table based on the date values of another table. I have two name fields {table.month} and {table.year} I need to select another record that has {anothertable.startdate,(dd,mm,yyyy)} and {anothertable.enddate,(dd,mm,yyyy)}. Any ideas on the best way to do this?

Thanks for any help

[bigears]
 
Hallo sbrunswik,

If the fields {table.month}/{table.year} are a string value
then use the following in the record selection formula

(tonumber({table.year}) = year({anothertable.startdate,(dd,mm,yyyy)}) or
tonumber({table.year}) = year({anothertable.enddate,(dd,mm,yyyy)})) and
(tonumber({table.month}) = month({anothertable.startdate,(dd,mm,yyyy)}) or
tonumber({table.month}) = month({anothertable.enddate,(dd,mm,yyyy)}))

I have assumed that the {table.year} = '2004' and
{table.month} = '2'
I have writtern the record selection formula so that the startdate and enddate are in the same year and month. Modify to suit your needs.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top