[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Computed column

Posted on 2009-07-12
3
Medium Priority
?
223 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

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 I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

650 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