Cold Fusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingCold Fusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 26th, 2005, 03:38 PM
paulkrumrey paulkrumrey is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2005
Posts: 1 paulkrumrey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 55 sec
Reputation Power: 0
Question Inserting dates into MS Access

We are having a problem trying to insert dates into MS Access here is the code we are using:


Code:
 
INSERT INTO items (assetid, description, caretaker, category, status, model, 
serialnum, dateassigned, purchaseprice, comments, office, soldprice, courtunit, 
brand, room, accountable, removed, imported, active, reason, ordernum, linenum) 
 
VALUES (#tempid#,'#FORM.description#',#FORM.caretaker#,#F  ORM.category#,
#FORM.status#, '#FORM.model#','#FORM.serialnum#', 
<CFIF FORM.dateassigned IS NOT"">#CreateODBCDate(FORM.dateassigned)#<CFELSE>NULL</CFIF>, 
'#FORM.purchaseprice#','#FORM.comments#',#FORM.off  ice#,'',#FORM.courtunit#, 
'#FORM.brand#','#FORM.room#',#FORM.accountable#,0,  0,1,'','',0)
 


The result is "data type mismatch in criteria expression"

Reply With Quote
  #2  
Old June 20th, 2005, 12:51 PM
stimulata stimulata is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2005
Posts: 1 stimulata User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 19 sec
Reputation Power: 0
Arrow

Quote:
Originally Posted by paulkrumrey
We are having a problem trying to insert dates into MS Access here is the code we are using:


Code:
 
INSERT INTO items (assetid, description, caretaker, category, status, model, 
serialnum, dateassigned, purchaseprice, comments, office, soldprice, courtunit, 
brand, room, accountable, removed, imported, active, reason, ordernum, linenum) 
 
VALUES (#tempid#,'#FORM.description#',#FORM.caretaker#,#F  ORM.category#,
#FORM.status#, '#FORM.model#','#FORM.serialnum#', 
<CFIF FORM.dateassigned IS NOT"">#CreateODBCDate(FORM.dateassigned)#<CFELSE>NULL</CFIF>, 
'#FORM.purchaseprice#','#FORM.comments#',#FORM.off  ice#,'',#FORM.courtunit#, 
'#FORM.brand#','#FORM.room#',#FORM.accountable#,0,  0,1,'','',0)
 


The result is "data type mismatch in criteria expression"


A couple of things occur to me:
Caretaker, Category, and Status all appear to need single
quotes around their values;
If you haven't already assigned a value to Dateassigned,
it probably already is Null, so you don't need to put anything
in the CFELSE statement;
Office may need quotes around its value;
Purchaseprice may not need quotes around its value;
Room may not need quotes around its value;
Soldprice can be left blank, no single quotes needed, just a comma;
Accountable may need single quotes around its value;
Reason may not need single quotes, just the comma;
Ordernum may not need single quotes, just the comma;
If you're not sure which part is wrong, just try eliminating
all but the first column, then add each column (field) until
you get the error(s) pinned down.
Good luck,

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingCold Fusion Development > Inserting dates into MS Access


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap