Solved

Computed column

Posted on 2009-07-12
3
168 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
  • 2
3 Comments
 
LVL 142

Accepted Solution

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

Open in new window

0
 
LVL 142

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now