Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with updating date in cfquery using access 1

Status
Not open for further replies.

knightjb1

Programmer
Feb 12, 2008
27
0
0
US
Hi,
I have read some of the other posts on this and none of them have seemed to help me so I am hoping someone can tell me specifically what I am doing wrong in my own code.

First off I have a date field that I am pulling from a database by the ID of the table. Then I want the user to be able to change the date and re-submit it back to the database. Sounds simple...

This is my update query...

<cfquery datasource="DATES">
UPDATE DATES
SET DATE = #Form.DATE#>
WHERE ID = "#Form.ID#"
</cfquery>

This is my form....
input type="text" name="DATE" value="#DateFormat#" />

and this is what is generating the value in the form...

<cfquery name="getInfo" datasource="DATES">
SELECT * FROM DATES
WHERE ID = #URL.ID#
</cfquery>

It is pulling the date from the database in its format displaying it to the user allowing them to change it and putting it back in the database. I have tried every formatting method under the son to get this to work but All i ever get is "Syntax error in UPDATE statement. " but it sees the format just fine (SQL UPDATE DATES SET DATE = 2008-02-12 00:00:00.0> WHERE ID = "1")

Anyone know what could be wrong
 
Wow...lol i think i need to read up on reserved words. thanks for the help again lol
 
You are welcome. Keep in mind the MS docs do not necessarily list all reserved words. The keywords can vary for different db versions, and even different driver versions. CF's plain Access Driver has different reserved words than the Unicode Access Driver. That surprises a lot of people.

----------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top