Go Back   Rhinocerus > Newsgroup > Newsgroup comp.databases.ms-access

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 02-06-2006, 08:23 PM
jerry.ranch@pioneer.com
Guest
 
Posts: n/a
Default DateSerial ()

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
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 02-06-2006, 08:44 PM
Randy Harris
Guest
 
Posts: n/a
Default Re: DateSerial ()


<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.

Reply With Quote
  #3 (permalink)  
Old 02-06-2006, 09:44 PM
Joost
Guest
 
Posts: n/a
Default Re: DateSerial ()

I would say the Format function. Format(yourdate,"m")

Reply With Quote
  #4 (permalink)  
Old 02-06-2006, 10:40 PM
inkman04
Guest
 
Posts: n/a
Default Re: DateSerial ()

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


Reply With Quote
  #5 (permalink)  
Old 02-07-2006, 04:00 AM
pamelafluente@libero.it
Guest
 
Posts: n/a
Default Re: DateSerial ()

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


Reply With Quote
  #6 (permalink)  
Old 02-07-2006, 04:14 AM
Randy Harris
Guest
 
Posts: n/a
Default Re: DateSerial ()

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

>


Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 01:46 PM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.