[AccessD] IIF statement

ggonzalez at cccis.com ggonzalez at cccis.com
Fri Mar 5 10:53:47 CST 2004





Oleg, the isnull() function in SQL server works differently than in access.
This function acctually does somthing when it finds a null value, i.e
isNull([Ron Data mid].[SW_Date_Closed,0) this would return a 0 when it
finds a null value

you would want to do somthing like the following

      PipeLine =
                  CASE  WHEN dbo.TBLASG_PIPELINE.NOTESUNID IS NOT NULL
                              THEN 1
                        ELSE 0
                        END,

hope this helps


                                                                                                                                               
                      <Oleg_123 at xuppa.com>                                                                                                     
                      Sent by:                         To:       <accessd at databaseadvisors.com>                                                
                      accessd-bounces at databasea        cc:                                                                                     
                      dvisors.com                      Subject:  Re: [AccessD] IIF statement                                                   
                                                                                                                                               
                                                                                                                                               
                      03/05/2004 09:33 AM                                                                                                      
                      Please respond to Access                                                                                                 
                      Developers discussion and                                                                                                
                      problem solving                                                                                                          
                                                                                                                                               




i get 'missing operator' error
and the word WHEN is
highlighted

W_Date_Closed =
CASE  WHEN (NOT isNull([Ron Data mid].[SW_Date_Closed]))
                     THEN         [SW_Date_Closed]
ELSE WHEN (NOT isNull([Ron Data mid].[OW_Date_Closed]))
                        THEN      [OW_Date_Closed]
ELSE [MSS_Date_Closed]
 END


>
>
>
>
> have you tried using a case statment
>
> MonthlyAmount =
>                   CASE  WHEN dbo.TBLASG_PIPELINE.PRODISYEARLY = '1'
>                               THEN dbo.TBLASG_PIPELINE.PRODAMOUNT / 12
>                         ELSE dbo.TBLASG_PIPELINE.PRODAMOUNT
>                         END
>
>
>
>
>                       <Oleg_123 at xuppa.com>
>
>                     Sent by:
>   To:       <accessd at databaseadvisors.com>
>
> accessd-bounces at databasea        cc:
>
>                     dvisors.com
>   Subject:  [AccessD] IIF statement
>
>
>
>                       03/05/2004 08:25 AM
>
>                     Please respond to Access
>
>                                         Developers
> discussion and
>
>          problem solving
>
>
>
>
>
>
>
> Hey group, i am still trying to figure out how to do else in an IIF
> t-sql statement
>
> this part works fine --
>
>  (IIf([Ron Data mid].DEPT In ("MSS","MID","SW","OW"),[Ron Data mid].[MS
> Date Opened])) AS NewDateOpened,
>
> however i d'like every other department to get data from a differnt
> column . How should i do it ?
>
>  (IIf([Ron Data mid].DEPT In ("MSS","MID","SW","OW"),[Ron Data mid].[MS
> Date Opened])ELSE [MID_Date_Opened]) AS NewDateOpened,
>
> oleg
>
>
> -----------------------------------------
> Get Breaking News from CNN, ABC, NBC, CBS Now.
> http://www.xuppa.com/news/?link=webmail
>
>
> --
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>
> --
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com



-----------------------------------------
Get Breaking News from CNN, ABC, NBC, CBS Now.
http://www.xuppa.com/news/?link=webmail


--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list