MartyConnelly
martyconnelly at shaw.ca
Tue Nov 28 15:49:58 CST 2006
Try this to see what is happening. Debug.Print "INSERT INTO tWeeklyUpdateSent ( DateSent ) " & "SELECT #" & dtToday & "#;" Beach Access Software wrote: >I'll ask. Thanks. > >Rocky > > >-----Original Message----- >From: accessd-bounces at databaseadvisors.com >[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of McGillivray, Don >[IT] >Sent: Tuesday, November 28, 2006 12:02 PM >To: Access Developers discussion and problem solving >Subject: Re: [AccessD] ADO Problem > >Let's assume that the original error was the result of 11/28/2006 being >interpreted as "11 divided by 28 divided by 2006". That's near enough to >zero to cause the date result of 1/1/1900. The new error suggests that >since "#11" is not a number it is being seen as as a column name which is to >be divided by 28 and then by 2006. #11 does not exist as a column name, >hence the error. Is dtToday dimmed as a date datatype? If not, that might >be the problem. > >HTH > >Don > >-----Original Message----- >From: accessd-bounces at databaseadvisors.com >[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Beach Access >Software >Sent: Tuesday, November 28, 2006 11:36 AM >To: 'Access Developers discussion and problem solving' >Subject: Re: [AccessD] ADO Problem > >Using: > >"SELECT #" & dtToday & "#" > >He gets an error message: > >Invalid column name '#11' > >dtToaday does contain 11/28/2006 > >What else could it be? > >MTIA > >Rocky > > >-----Original Message----- >From: accessd-bounces at databaseadvisors.com >[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of McGillivray, Don >[IT] >Sent: Tuesday, November 28, 2006 10:39 AM >To: Access Developers discussion and problem solving >Subject: Re: [AccessD] ADO Problem > >Hi, Rocky. > >Just a WAG (I don't know ADO), but how 'bout: > > Conn.Execute "INSERT INTO tWeeklyUpdateSent ( DateSent ) " & _ > "SELECT #" & dtToday & "#;" > >Don > >-----Original Message----- >From: accessd-bounces at databaseadvisors.com >[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Beach Access >Software >Sent: Tuesday, November 28, 2006 10:15 AM >To: 'Access Developers discussion and problem solving' >Subject: [AccessD] ADO Problem > >Dear List: > >A colleague (who thinks I know ADO) writes in to ask why the following: > > Conn.Execute "INSERT INTO tWeeklyUpdateSent ( DateSent ) " & _ > "SELECT " & dtToday & "" > >Inserts a record into tWeeklyUpdateSent so the conection is OK. But but the >date is 1/1/1900 instead of today's date. > >I had him check the contents of dtToday and it does indeed have 11/28/2006 >in it. > >Does anyone see what he's doing wrong here? > > >MTIA > >Rocky > > > > -- Marty Connelly Victoria, B.C. Canada