[AccessD] Technical test for developers

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Wed May 14 13:47:36 CDT 2003


>   Format(Date, "MM\/DD\/YYYY")
> is the one to use. It will never fail.
Gustav,

I think that

Format(Date, "YYYY\/MM\/DD")

should never fail too.

As for this: Format(Date, "DD\/MM\/YYYY") - as I wrote it will work
correctly if day number is greater than 12... - of course it CANNOT be
recommended for use...

And I think that Format(Date, "YYYY\/MM\/DD") is easier to interpret for
Europeans when they see the result of such formatting in SQL expressions...

Shamil

----- Original Message -----
From: "Gustav Brock" <gustav at cactus.dk>
To: <accessd at databaseadvisors.com>
Sent: Wednesday, May 14, 2003 8:43 PM
Subject: Re: [AccessD] Technical test for developers


> Hi Charlotte
>
> > I can't help it if what I meant and what I said don't coincide.  Didn't
> > you see the disclaimer at the bottom of my post?  Oh, yeah, that's
> > right.  I forgot about the disclaimer.   Hmmn. <VBG>
>
> > What I meant was that if you format it, you need to be sure the format
> > corresponds to a US Date format, which is mm/dd/yyyy.
>
> Yes, Shamil, Charlotte is right:
>
>   Format(Date, "MM\/DD\/YYYY")
>
> is the one to use. It will never fail.
>
> /gustav
>
>
> > -----Original Message-----
> > From: Gustav Brock [mailto:gustav at cactus.dk]
> > Sent: Wednesday, May 14, 2003 7:54 AM
> > To: accessd at databaseadvisors.com
> > Subject: Re: [AccessD] Technical test for developers
>
>
> > Hi Charlotte
>
> > Oops, Charlotte - totally confused after a hard night's sleep?
>
> > /gustav
>
>
> >> That's assuming that the date is being inserted is in US format
> >> already, as SQL requires.  If you format it, it may no longer be in US
> >> format.
>
> >> Charlotte Foust
>
> >> -----Original Message-----
> >> From: Shamil Salakhetdinov [mailto:shamil at smsconsulting.spb.ru]
> >> Sent: Wednesday, May 14, 2003 2:30 AM
> >> To: accessd at databaseadvisors.com
> >> Subject: Re: [AccessD] Technical test for developers
>
> >>> You might change your code in Access programming #2 to: db.Execute
> >>> "INSERT INTO tblUpdateLog (ulDate, ulRecordCount ) VALUES ( #" & Date
>
> >>> & "#, " & FlagCount & ") " which would show a lack of experience -
> >>> and
>
> >>> then see if they change it to
> >>> use:
> >>> ---------------------------
> >>> Dim strSQL As String
> >>> strSQL = "INSERT INTO tblUpdateLog (ulDate, ulRecordCount ) VALUES (
> >>> #" & Date & "#, " & FlagCount & ") " db.Execute strSQL
>
> >> BTW, both are incorrect - instead of Date you should have used:
>
> >> Format(Date, "MM\/DD\/YYYY")
>
> >> or
> >> Format(Date, "YYYY\/MM\/DD")
>
> >> even this
>
> >> Format(Date, "DD\/MM\/YYYY")
> >> should work corectly if day number is greater than 12...
>
> >> Or was it a kind of trap-test?
>
> >> Shamil
>
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com



More information about the AccessD mailing list