I am a new programmer. I have a simple question about databases and I apologize if this question is so basic, but I have been looking for quite a while and cannot find a straight answer on the web or in any of my books. All I am trying to do is to simply insert the computer's current date into an SQL query.
For example: I have a web form, where the users enter in a series of text boxes. I have a column in my database for the date. So, when the user types in his/her form and submits, I want to insert the current date (not time or seconds, just the date). The queries would go something like:
INSERT INTO TS.TP_SUBD(NAME, Address, Date)
VALUES('form.Name', 'form.Address', 'now')
UPDATE NAMETS
SET NAME = 'form.Name',
Address = 'form.Address',
Date = 'now'
WHERE NAMETS.Name = 'form.Name'
What I have for 'now' would be the current date, but that doesn't work. Any ideas on what I need to do? I feel a little sheepish asking but...
For example: I have a web form, where the users enter in a series of text boxes. I have a column in my database for the date. So, when the user types in his/her form and submits, I want to insert the current date (not time or seconds, just the date). The queries would go something like:
INSERT INTO TS.TP_SUBD(NAME, Address, Date)
VALUES('form.Name', 'form.Address', 'now')
UPDATE NAMETS
SET NAME = 'form.Name',
Address = 'form.Address',
Date = 'now'
WHERE NAMETS.Name = 'form.Name'
What I have for 'now' would be the current date, but that doesn't work. Any ideas on what I need to do? I feel a little sheepish asking but...