Place the data into a table. The easiest way it to have a StartingDate and
EdingDate for each Sign. Supply a fix year, say 2000, to have a complete
date, with a year, in addition to the month and day.
HoroscopeTable ' table name
StartingDate EndingDate Sign ' fields name
2000.11.23 2000.12.21 Sagitarus
2000.12.21 2000.12.31 Capricorn
2000.01.01 2000.01.19 Capricorn
2000.01.20 2000..... .... ' data
Then use a DLookup:
DLookup("Sign", "HoroscopeTable", Format(CDate(DateSerial( 2000,
yourMonth, yourDay), "/#mm-dd-yyyy/#" ) & " BETWEEN startingDate AND
endingDate" )
(note that Capricorn,in the table, is broken in two parts, to get the
BETWEENess correctly considered).
I assume you don't need astronomical precision, ie, Sagitarus always end the
21st of December for EACH and EVERY year.
Vanderghast, Access MVP
"Jeff" <(E-Mail Removed)> wrote in message
news:0C749C71-7F26-48D9-902F-(E-Mail Removed)...
> Hi Everyone,
>
> I am building a page about Horoscopes. The user key in a day (in Date
> datatype), then it automatically displays a Horoscopes. There must be
> something like:
>
> If InputDate Between Nov 23 And Dec 21 Then
> txtHoro = "Sagittarius"
> ElseIf InputDate Between Dec 22 And Jan 19 Then
> txtHoro = "Capricorn"
> ..................................
> End If
>
> Could someone help me write this in codes? No idea how to convert just
> month
> & day in Date type. Thank you.
>
> --
> Jeff
|