Converting Date in SQL Server

    Date: 10/30/09 (Asp Dot Net)    Keywords: database

    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?

    Source: http://aspdotnet.livejournal.com/103632.html

« Using DataRelation in DataSet || Postback question »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home