[AccessD] Technical test for developers

Gustav Brock gustav at cactus.dk
Wed May 14 11:43:41 CDT 2003


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



More information about the AccessD mailing list