AccessUser22
Technical User
Hello,
I have a field in a query that I want to either show a dashed value '---' or a date. So I use this:
CASE WHEN [RegStatus] = 4 THEN '---' ELSE [Step7Date] END AS Step7
Problem is, it tells me "Conversion of the char data type to date time has resulted in an out of range value". If I set it up like this:
CASE WHEN [RegStatus] = 4 THEN '---' ELSE CAST([Step7Date] as nvarchar) END AS Step7
the date gets formatted as Apr 20, 2002 12:00:00 AM. What do I need to do if I want the date to be formatted as '4/20/02'?
I have a field in a query that I want to either show a dashed value '---' or a date. So I use this:
CASE WHEN [RegStatus] = 4 THEN '---' ELSE [Step7Date] END AS Step7
Problem is, it tells me "Conversion of the char data type to date time has resulted in an out of range value". If I set it up like this:
CASE WHEN [RegStatus] = 4 THEN '---' ELSE CAST([Step7Date] as nvarchar) END AS Step7
the date gets formatted as Apr 20, 2002 12:00:00 AM. What do I need to do if I want the date to be formatted as '4/20/02'?