an idiot (cndnbcn85) wrote in aspdotnet,
an idiot
cndnbcn85
aspdotnet

Converting Date in SQL Server

I've been looking around everywhere, but either don't know how to search for it or don't know what I'm looking at... but I'm trying to convert dates that I pull from a database from 30/10/2009 00:00:00AM or whatever it comes up as to just the date. I found a convert statement, but have no idea where to put it in my select statement (or if it goes somewhere else).

I tried
SELECT ID, title, caption, credit, date (CONVERT(VARCHAR(8), GETDATE(), 1) AS [MM/DD/YY]) FROM MMphotos WHERE (ID = @ID)

and
SELECT * FROM MMphotos WHERE (ID = @ID) CONVERT(VARCHAR(8), GETDATE(), 1) AS [MM/DD/YY]

But neither worked... but both returned different errors. First one is saying "'date' is not a recognized built-in function name" and the second was saying "Incorrect syntax near the keyword 'CONVERT'"

What am I mucking up?
  • Post a new comment

    Error

    default userpic
  • 9 comments