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

ARRAY OF DATES: Select ing the smallest/b

Status
Not open for further replies.

akasmia

MIS
Apr 12, 2002
30
US
This is very simple:
I have 4 dates in Microsoft Access:
DATE1 DATE2 DATE3 DATE4
in a table. I add nothing to DATE1, 2 years to DATE2, 2 years to DATE3 and 1 year to DATE4. I generate the following dates:

DATE1_Plus, DATE2Plus2, DATE3pLUS2, DATE4pLUS1

and store them in a form (txtBox1, txtBox2, txtBox3 txtBox4). Up to here the form and tables work fine.

I need to pick the earliest date. I tried:
MIN(txtBox1, txtBox2, txtBox3, txtBox4) did not wark
small(txtBox1, txtBox2, txtBox3, txtBox4, k) did not work


All I need is the smallest number in the array of dates: (DATE1_Plus, DATE2Plus2, DATE3Plus2, DATE4Plus1)

Easy hah!

I will try to play with it again today...!
 
I think you want to use 'SELECT TOP' or 'SELECT BOTTOM' in your SQL not MAX or MIN.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top