Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you have a calculated field in a SQL table? 1

Status
Not open for further replies.

tburrows

Technical User
Oct 3, 2003
49
0
0
US
I am using Access to access a SQL table. What I am trying to do is that I have a date field called DateCleared. I have another field called Cleared. What I want to do is that if DateCleared is empty then Cleared is No and if DateCleared has a date in it then Cleared is Yes.
I am familiar with Access but new to SQL.

Thanks
Tom
 
Yes, you can have a calculated column in SQL Server. In the design view of the table in Enterprise Manager select the column you want to set, then select the forumla line below. Then enter the T/SQL forum you want.

For example:
case when DateCleared is null then 'No' else 'Yes' end

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(My very old site)
 
no problem

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(My very old site)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top