|
 |
access thread: Query Builder
Message #1 by "KennethMungwira" <KennethMungwira@y...> on Thu, 31 Oct 2002 15:46:20
|
|
Access 97, I have a query which is giving me the run around. I am
querying two tables, but I need to return MW's if the refPlantMain is
Null.
Able: IIf([refPlantMain].[PlantCapacity]<[Main].[MW],[refPlantMain].
[PlantCapacity],[Main].[MW])
Now this query returns Plant Capacity if Main table MW number is larger
that Plant Capacity, but if it is not then it returns MW from the Main
table. But I need it to return the Main .MW if the Plant Capacity
is "0"(Null).
Thank you
Message #2 by "Wesley Kendrick" <wez.k@n...> on Thu, 31 Oct 2002 15:46:28 -0000
|
|
Hi Kenneth, try this
Able: IIf([refPlantMain].[PlantCapacity]< [Main].[MW] Or
([refPlantMain].[PlantCapacity] = "0",[refPlantMain].
[PlantCapacity],[Main].[MW])
Regards, Wesley Kendrick
----- Original Message -----
From: "KennethMungwira" <KennethMungwira@y...>
To: "Access" <access@p...>
Sent: Thursday, October 31, 2002 3:46 PM
Subject: [access] Query Builder
> Access 97, I have a query which is giving me the run around. I am
> querying two tables, but I need to return MW's if the refPlantMain is
> Null.
>
> Able: IIf([refPlantMain].[PlantCapacity]<[Main].[MW],[refPlantMain].
> [PlantCapacity],[Main].[MW])
>
> Now this query returns Plant Capacity if Main table MW number is larger
> that Plant Capacity, but if it is not then it returns MW from the Main
> table. But I need it to return the Main .MW if the Plant Capacity
> is "0"(Null).
>
> Thank you
>
Message #3 by joe.dunn@c... on Thu, 31 Oct 2002 15:45:42 +0000
|
|
<Original message>
Able: IIf([refPlantMain].[PlantCapacity]<[Main].[MW],[refPlantMain].
[PlantCapacity],[Main].[MW])
Now this query returns Plant Capacity if Main table MW number is larger
that Plant Capacity, but if it is not then it returns MW from the Main
table. But I need it to return the Main .MW if the Plant Capacity
is "0"(Null).
<response>
Try
IIf([refPlantMain].[PlantCapacity] = 0 or IsNull
([refPlantMain].[PlantCapacity]),
[Main].[MW],
IIf([refPlantMain].[PlantCapacity]
<[Main].[MW],[refPlantMain].[PlantCapacity],
[Main].[MW]))
*************************************************************************
This e-mail may contain confidential information or be privileged. It is intended to be read and used only by the named
recipient(s). If you are not the intended recipient(s) please notify us immediately so that we can make arrangements for its return:
you should not disclose the contents of this e-mail to any other person, or take any copies. Unless stated otherwise by an
authorised individual, nothing contained in this e-mail is intended to create binding legal obligations between us and opinions
expressed are those of the individual author.
The CIS marketing group, which is regulated for Investment Business by the Financial Services Authority, includes:
Co-operative Insurance Society Limited Registered in England number 3615R - for life assurance and pensions
CIS Unit Managers Limited Registered in England and Wales number 2369965 - for unit trusts and PEPs
CIS Policyholder Services Limited Registered in England and Wales number 3390839 - for ISAs and investment products bearing the CIS
name
Registered offices: Miller Street, Manchester M60 0AL Telephone 0161-832-8686 Internet http://www.cis.co.uk E-mail
cis@c...
CIS Deposit and Instant Access Savings Accounts are held with The Co-operative Bank p.l.c., registered in England and Wales number
990937, P.O. Box 101, 1 Balloon Street, Manchester M60 4EP, and administered by CIS Policyholder Services Limited as agent of the
Bank.
CIS is a member of the General Insurance Standards Council
CIS & the CIS logo (R) Co-operative Insurance Society Limited
********************************************************************************
|
|
 |