View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ajitrajput ajitrajput is offline
external usenet poster
 
Posts: 1
Default Entering Date via SQL Query

My underlying database is Excel and I am writing all DB relate
operations using ADO in Visual Basic Editor of Excel (VBA). I am usin
Excel Driver. The data is stored directly into Excel columns a
mentioned in the insert query.

But, when I enter the date value in a column, it attaches
single-quote(') before the value. I have applied date-formatting to th
respective column as (mm/dd/yyyy), but still it doesn't work. I want t
programmatically enter the date value without any single-quote i.e th
value should be treated as date datatype.

Because of this single-quote(') to the date value which the date-valu
in the cell to be considered as TEXT and hence whenever I want to fetc
records between date-range, the SELECT query does not pick-up prope
records.

[Since the end-user of my application will not open the files and mak
manual changes, i want the proper date entry to be made without an
single quote...]

Sample Query:
INSERT INTO [mms_instrDR_dtl$](strInstrSeqNbr, dtDR
dtCreated,strCreatedBy
VALUES('CLDEL01040400002',#7/21/2004#,#7/21/2004#,'ajit')

Please help me !!! Trying from last 2 days.

--
Message posted from http://www.ExcelForum.com