?
Solved

Computed column

Posted on 2009-07-12
3
Medium Priority
?
217 Views
Last Modified: 2012-05-07
Hello - I'm having trouble setting up a formula for a computed column in SQL Server 2000

I want to have a literal ">" with a particular date field when that date field contains a null. In the "Formula",  tried: CASE WHEN ISDATE(MyDateField) THEN '' ELSE '>' END
but this gets a syntax error.

(Doing this as a computed column in the table is a lazy fall-back to just doing it as an expression in a View, because the View Deigner in Enterprise Manager does not support CASE statements. If there is a better way, please tell me)

Thanks
0
Comment
Question by:mlagrange
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 24835301
it must be:
CASE WHEN ISDATE(MyDateField) = 1 THEN '' ELSE '>' END

Open in new window

0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24835303
>I want to have a literal ">" with a particular date field when that date field contains a null.

CASE WHEN MyDateField IS NULL THEN '>' ELSE '' END

Open in new window

0
 

Author Comment

by:mlagrange
ID: 24835903
Great - Thanks!
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question