June 16, 2007 at 8:34 am
I am getting an error saying date is not a current fucntion, I am using the following SQL query:
INSERT INTO Employees(Rtype, Amount, Refnumber, Color, Date)
SELECT Rtype, 34, Refnumber, Color, Date(CURRENT_TIMESTAMP)
FROM Employees
WHERE Amount=-34 AND Rtype = 'AD';
Any suggestions?
June 16, 2007 at 1:32 pm
The error is correct... Since you want to use the CURRENT_TIMESTAMP as the DATE column, you need to create a column alias... like this...
INSERT INTO Employees
(Rtype, Amount, Refnumber, Color, Date)
SELECT Rtype, 34, Refnumber, Color, CURRENT_TIMESTAMP AS Date
FROM Employees
WHERE Amount = -34
AND Rtype = 'AD'
Not trying to be condescending, by any means, but this seems a bit like a "newbie" problem... you might want to make a trip by W3Schools.com for a decent SQL Tutorial.
--Jeff Moden
Change is inevitable... Change for the better is not.
June 16, 2007 at 8:12 pm
Hi Jeff,
That is not condescending at all, and I know its pretty obvious that I am a newbie, but that is why I am here in this forum with all you experts....so I can learn.....from the best (Smile)
Thank you for the link there I will check it out, I found one link that has a tutorial where you can actual practice with queries, but there is not a lot of statements you can do with it. But thank you for looking out, have a good night.
Mark
June 17, 2007 at 10:01 am
Thanks for the feedback and for not taking it the wrong way, Mark. You have exactly the right frame of mind to do very well in all of this... It'll be my pleasure to help whenever I can.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply