Group:  Microsoft Access ยป microsoft.public.access.gettingstarted
Thread: date format

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

date format
Sten Melin 02.08.2006 09:24:01
im sorry for my ignorance but i need help with i suppose a quite simple
problem.

i got two imported text fields.
These two text fields got date informtion presented in yyyymmdd ie 20060802
(the shortdate in my zone is yyyy-mm-dd)

I understand i need to change the format to Date/Time before calculating the
datediff. I cant use the shortdate and therefore been trying to use the
format yyyymmdd but cant get it to work.

could someone please help me ?

Re: date format
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_canada.com> 02.08.2006 11:14:12
To change a text field in yyyymmdd format to a date field, try:

CDate(Format(TextDate, "0000\-00\-00"))

That format statement will convert the text to yyyy-mm-dd, which CDate can
then recognize.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Sten Melin" <StenMelin[ at ]discussions.microsoft.com> wrote in message
news:8617E1CA-18E1-4165-A391-1F04CE936E7F[ at ]microsoft.com...
[Quoted Text]
> im sorry for my ignorance but i need help with i suppose a quite simple
> problem.
>
> i got two imported text fields.
> These two text fields got date informtion presented in yyyymmdd ie
> 20060802
> (the shortdate in my zone is yyyy-mm-dd)
>
> I understand i need to change the format to Date/Time before calculating
> the
> datediff. I cant use the shortdate and therefore been trying to use the
> format yyyymmdd but cant get it to work.
>
> could someone please help me ?
>


Re: date format
Sten Melin 06.08.2006 09:11:01
Thanks Douglas, thanks a lot for your time.


"Douglas J. Steele" skrev:

[Quoted Text]
> To change a text field in yyyymmdd format to a date field, try:
>
> CDate(Format(TextDate, "0000\-00\-00"))
>
> That format statement will convert the text to yyyy-mm-dd, which CDate can
> then recognize.
>
> --
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no private e-mails, please)
>
>
> "Sten Melin" <StenMelin[ at ]discussions.microsoft.com> wrote in message
> news:8617E1CA-18E1-4165-A391-1F04CE936E7F[ at ]microsoft.com...
> > im sorry for my ignorance but i need help with i suppose a quite simple
> > problem.
> >
> > i got two imported text fields.
> > These two text fields got date informtion presented in yyyymmdd ie
> > 20060802
> > (the shortdate in my zone is yyyy-mm-dd)
> >
> > I understand i need to change the format to Date/Time before calculating
> > the
> > datediff. I cant use the shortdate and therefore been trying to use the
> > format yyyymmdd but cant get it to work.
> >
> > could someone please help me ?
> >
>
>
>

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net