Inserting Date into table help

  • Thread starter Thread starter tiger
  • Start date Start date
T

tiger

Hi,

I have a field in my table called DDate of type short date. When I try to
insert it into a table using the query below...I get an error messages like

- Data type mismatch in criteria expression
- Invalid use of Null

..CommandText = "INSERT INTO tblTime (DDate) VALUES ('"& Format
(txtDate1,"\#mm\/dd\/yyyy\#")&"')"

txtDate1 is a textbox name where the date is entered.

Thanks
Tiger
 
from Rainbow01 Hong Kong

no need to type # when using Format function
i.e. Format(txtDate1,"mm/dd/yyyy")

"tiger" 來函:
 
This information is incorrect.

The # delimiter will assist in ensuring the date is interpreted correctly,
regardless of the regional setting.

The quote delimiter should be omitted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top