Incorrect syntax near 'ProjectOverview'.
Hello,
Please help me with my problem, this is the simple select statement I have for target bid date:
Code:
ProjectOverview.[Target Event Date - Date] AS [Target Bid Date]
now, I want to ask how can I select the latest target event date and if value is null, put "no date" caption
i tried doing this:
Code:
isnull MAX(ProjectOverview.[Target Event Date - Date],'INACTIVE') AS [Target Bid Date]
but it says:
Incorrect syntax near 'ProjectOverview'.
String cannot be converted to date
Thank you very much and I am hoping someone can help me.
Re: Incorrect syntax near 'ProjectOverview'.
You are getting the MAX of a date column so the value returned must be either type date or NULL. You can't substitute a string where a date is expected. It would make far more sense to just return NULL from the database and then display a place-holder at the application level.
Re: Incorrect syntax near 'ProjectOverview'.
Okay how about I get only the max of date?
Code:
ProjectOverview.[Target Event DATE - DATE] AS [Target Bid DATE]
I get below error when i try this code:
Code:
Max(ProjectOverview.[Target Event DATE - DATE]) AS [Target Bid DATE]
Thank you jmcilhinney
Re: Incorrect syntax near 'ProjectOverview'.
You didn't post the error message. Also is 'Target Event DATE - DATE' one column or two? If it's one the it's an abominable name. If it's two, why is it grouped as one?