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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using @Where?

Status
Not open for further replies.

smooveb

IS-IT--Management
Joined
Jul 20, 2001
Messages
161
Location
US
Hi everyone,

I'm trying to pull the min(date2 - date1). However, I believe that in some cases date 2 might be null, giving me a min(date2 - date1) in the negative.

So, to try to work around this, I only want the min(date2 - date1) where both dates are NOT NULL. I've been trying to use @where for this, but can't seem to figure out the proper syntax. Any aid would be greatly appreciated. Thanks!

Barrett
 
@Where is not going to help you at all. @Where is just like @Select. It gives you the where portion of an existing object.

What you need in your case is a CASE statement at the database level. I don't know what your database is, but you need to evaluate date1 and date2 before doing the subtraction.

Steve Krandel
Knightsbridge Solutions
formerly BASE Consulting Group
 
Hmmm, thanks Steve. I was really hoping I could use the Case statement somehow at the designer level.

B
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top