I am trying the simplest thing, and for some reason my fingers can't seem to type in the right coding... I want to insert a record into a database and use today's date in one of the fields. Here's my code:
Ribeyed: how about offering some help instead of critizing the tools I use? Not everyone can afford Dreamweaver, but that's not the point of my posting.
Is there anything actually wrong with the bit of code I posted? Aren't the # symbols supposed to enforce the entry of a date format???
hi,
at first look there doesn't seem to be a syntax error in your code, but saying that the code that frontpage generates for ASP is diiferent. I wouldn't be able to tell you if this part of your SQL is correct:
Code:
','::Initiator::','::Description::'
I would love to help you further but i need to know what error was generated, did you get an data type miss match error?
If your database field is of text type then your syntax is wrong, but if it is date/time type then i would write the SQL statement out to screen to check what values are being submitted.
Just comment out all the working for the SQL after the statment and your execute line. Put in the following
Code:
response.write fp_sQry
now you should see the sql query on the screen.
Your date should be displayed. Now you are looking to see if your date is being displayed like one of the following:
Code:
#12/12/2001#
or
'12/12/2001'
or
12/12/2001
so depending on your field in your database one of these will be correct. Also forgot to ask is it Access or SQl Server or another database you are using, again this will effect the syntax
Putting together a bit of what both of you suggested and a bit of my own wit, I got it working!! What was wrong in the first place was that I used "Date" for my field's name, and that's a big NO-NO!!!!! How come neither of you detected that? Well, I should have known better... Anyway, changing the field name to CorrActDate and using Dave's format date thing (thanks, I needed that for another page) and Ribeyed's suggestion to spell out the query, and I got it!!!!!
Thanks to both, and remember: it's not the power of the tools themselves that make the work extraordinary, but the art of the user!!! Michelangelo could have chiseled out the David with a soup spoon, it just would have taken him longer, that's all!!
Bookmarks