A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

WHERE CLAUSE



 
 
Thread Tools Display Modes
  #1  
Old November 20th, 2009, 11:15 AM posted to microsoft.public.access.queries
martin
external usenet poster
 
Posts: 442
Default WHERE CLAUSE

Hi,

I have a query that I need to assign a WHERE clause within the statement.
This is below:

Monthly Update: IIf([tblData]![RELATIONSHIP_TYPE]="*BR*",[tblData2]![Jan
'09]* [tblData3]![Rate] WHERE [tblData3]![Location Type] = "BR",0)

Does anyone know where I am going wrong here?

Any help woudl be appreciated.


  #2  
Old November 20th, 2009, 01:21 PM posted to microsoft.public.access.queries
Ken Snell
external usenet poster
 
Posts: 177
Default WHERE CLAUSE

WHERE clauses go in the WHERE box in the query grid, not in the Field box,
assuming that the WHERE clause is to apply to the entire query.

If you want this "WHERE" clause to apply within just the IIf function:

Monthly Update: IIf([tblData]![RELATIONSHIP_TYPE]="*BR*" AND
[tblData3]![Location Type] = "BR",[tblData2]![Jan
'09]* [tblData3]![Rate], 0)

--

Ken Snell
http://www.accessmvp.com/KDSnell/



"Martin" wrote in message
...
Hi,

I have a query that I need to assign a WHERE clause within the statement.
This is below:

Monthly Update: IIf([tblData]![RELATIONSHIP_TYPE]="*BR*",[tblData2]![Jan
'09]* [tblData3]![Rate] WHERE [tblData3]![Location Type] = "BR",0)

Does anyone know where I am going wrong here?

Any help woudl be appreciated.




  #3  
Old November 20th, 2009, 02:20 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default WHERE CLAUSE

I am guessing that you need to replace an equal with a like and add the rest
of the "where" into the IIF expressions first argument.

Monthly Update: IIf([tblData]![RELATIONSHIP_TYPE] LIKE "*BR*" AND
[tblData3]![Location Type] = "BR",[tblData2]![Jan '09]* [tblData3]![Rate], 0)

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Martin wrote:
Hi,

I have a query that I need to assign a WHERE clause within the statement.
This is below:

Monthly Update: IIf([tblData]![RELATIONSHIP_TYPE]="*BR*",[tblData2]![Jan
'09]* [tblData3]![Rate] WHERE [tblData3]![Location Type] = "BR",0)

Does anyone know where I am going wrong here?

Any help woudl be appreciated.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:09 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.