T-SQL Select a value
Posted on 2013-01-26
I am working with a query that I didn't write and I not sure how to interpret the SQL code.
I can't post the entire contents of the query but I will try to abbreviate what I am looking to interpret.
Select PurchaseDate from
Select 2000-01-01 as SortOrder
My question is the query is select a date value from the PurchaseDate Field and sort
from the earliest date of 2000-01-01.
The query seems to work correctly but I wasn't aware you can select a value you like this in T-SQL. My question is this a specific convention in SQL for selecting a value from a field as a sort order? Thanks for any feedback you can provide. I will try to post more of the query if my question isn't clear enough.