|
|||
|
I see that DateSerial can be used to "concatenate", in a way, three
fields DateSerial(year, month day) into a date field (if year , month and date are numeric values). Unfortunately, my Month field is Text (January, February etc). What function is used to convert text month to numerical 1-12? Thanks Jerry |
|
|
||||
|
||||
|
|
|
|||
|
<jerry.ranch@pioneer.com> wrote in message news:1uefu1p4qot76582aumfahkfv6gapvi55s@4ax.com... > I see that DateSerial can be used to "concatenate", in a way, three > fields DateSerial(year, month day) into a date field (if year , month > and date are numeric values). Unfortunately, my Month field is Text > (January, February etc). > What function is used to convert text month to numerical 1-12? > Thanks > Jerry I don't know of a "slick" way to do it, but Access is pretty smart about coercing dates. You could use: Month([MonthName] & " 1,2006") This is one of the reasons why dates should be stored as dates (not strings). Hope this helps. -- Randy Harris tech at promail dot com I'm pretty sure I know everything that I can remember. |
|
|||
|
Hello,
Perhaps you can look into the "Switch" function. Example: Switch([MonthName]="January",1,[MonthName]="February",2,[MonthName]="March",3,[MonthName]="April",4) Happy hunting. Regards jerry.ranch@pioneer.com wrote: > I see that DateSerial can be used to "concatenate", in a way, three > fields DateSerial(year, month day) into a date field (if year , month > and date are numeric values). Unfortunately, my Month field is Text > (January, February etc). > What function is used to convert text month to numerical 1-12? > Thanks > Jerry |
|
|||
|
Are you sure?
you mean something like: Month("January" & " 1,2006") Very smart indeed. -Pam >coercing dates. You could use: >Month([MonthName] & " 1,2006") > What function is used to convert text month to numerical 1-12? > Thanks > Jerry |
|
|||
|
Yes Pam, I'm sure. Take a closer look, it works.
-- Randy Harris tech at promail dot com I'm pretty sure I know everything that I can remember. <pamelafluente@libero.it> wrote in message news:1139288450.972778.172720@g14g2000cwa.googlegr oups.com... > Are you sure? > > you mean something like: Month("January" & " 1,2006") > > Very smart indeed. > > -Pam > > > >coercing dates. You could use: > > >Month([MonthName] & " 1,2006") > > > > > What function is used to convert text month to numerical 1-12? > > Thanks > > Jerry > |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|