PC Review


Reply
Thread Tools Rate Thread

Using Report Wizard to build report from Query

 
 
=?Utf-8?B?c3BhcnRhbm1iYQ==?=
Guest
Posts: n/a
 
      2nd Apr 2005
Hello,

I am using report wizard to build a report from a query. I receive an error
when I have the report wizard sum the gain_loss column of my query. The
syntax for the gain_loss column is below. The error reads, "The expression
is typed incorrectly, or it is too complex to be evaluated. For example, a
numeric expression may contain too many complicated elements. Try
simplifying the expression by assinging parts of the expression to
variables." I can run the query wtihout any error, but I cannot get the
repot wizard to sum the column. There is a nested if statement in my query.
I am not sure what to do. I am very new to Access.

IIf(fxsen.buy_CCY="USD",(IIf(fxsen.sell_ccy="EUR" Or
fxsen.sell_ccy="GBP",(fxsen.settle_rate-fxsen.contract_rate)*fxsen.buy*fxsen.settle_rate,(fxsen.settle_rate-fxsen.contract_rate)*fxsen.buy/fxsen.settle_rate)),(IIf(fxsen.buy_ccy="EUR"
Or
fxsen.buy="GBP",(fxsen.contract_rate-fxsen.settle_rate)*-fxsen.sell*fxsen.settle_rate,(fxsen.contract_rate-fxsen.settle_rate)*-fxsen.sell/fxsen.settle_rate))) AS Gain_Loss

Thanks for your help.
Regards,
John

 
Reply With Quote
 
 
 
 
Duane Hookom
Guest
Posts: n/a
 
      2nd Apr 2005
You might try wrap the entire IIf(.....) in Val( IIf(.....) )

--
Duane Hookom
MS Access MVP


"spartanmba" <(E-Mail Removed)> wrote in message
news:097C40F9-1AFE-4A71-9407-(E-Mail Removed)...
> Hello,
>
> I am using report wizard to build a report from a query. I receive an
> error
> when I have the report wizard sum the gain_loss column of my query. The
> syntax for the gain_loss column is below. The error reads, "The
> expression
> is typed incorrectly, or it is too complex to be evaluated. For example,
> a
> numeric expression may contain too many complicated elements. Try
> simplifying the expression by assinging parts of the expression to
> variables." I can run the query wtihout any error, but I cannot get the
> repot wizard to sum the column. There is a nested if statement in my
> query.
> I am not sure what to do. I am very new to Access.
>
> IIf(fxsen.buy_CCY="USD",(IIf(fxsen.sell_ccy="EUR" Or
> fxsen.sell_ccy="GBP",(fxsen.settle_rate-fxsen.contract_rate)*fxsen.buy*fxsen.settle_rate,(fxsen.settle_rate-fxsen.contract_rate)*fxsen.buy/fxsen.settle_rate)),(IIf(fxsen.buy_ccy="EUR"
> Or
> fxsen.buy="GBP",(fxsen.contract_rate-fxsen.settle_rate)*-fxsen.sell*fxsen.settle_rate,(fxsen.contract_rate-fxsen.settle_rate)*-fxsen.sell/fxsen.settle_rate)))
> AS Gain_Loss
>
> Thanks for your help.
> Regards,
> John
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?c3BhcnRhbm1iYQ==?=
Guest
Posts: n/a
 
      2nd Apr 2005
Duane,

I tried wrapping the Iif() like you said in the query, but I still get the
same error message from the report. Thanks for your help.

John

"Duane Hookom" wrote:

> You might try wrap the entire IIf(.....) in Val( IIf(.....) )
>
> --
> Duane Hookom
> MS Access MVP
>
>
> "spartanmba" <(E-Mail Removed)> wrote in message
> news:097C40F9-1AFE-4A71-9407-(E-Mail Removed)...
> > Hello,
> >
> > I am using report wizard to build a report from a query. I receive an
> > error
> > when I have the report wizard sum the gain_loss column of my query. The
> > syntax for the gain_loss column is below. The error reads, "The
> > expression
> > is typed incorrectly, or it is too complex to be evaluated. For example,
> > a
> > numeric expression may contain too many complicated elements. Try
> > simplifying the expression by assinging parts of the expression to
> > variables." I can run the query wtihout any error, but I cannot get the
> > repot wizard to sum the column. There is a nested if statement in my
> > query.
> > I am not sure what to do. I am very new to Access.
> >
> > IIf(fxsen.buy_CCY="USD",(IIf(fxsen.sell_ccy="EUR" Or
> > fxsen.sell_ccy="GBP",(fxsen.settle_rate-fxsen.contract_rate)*fxsen.buy*fxsen.settle_rate,(fxsen.settle_rate-fxsen.contract_rate)*fxsen.buy/fxsen.settle_rate)),(IIf(fxsen.buy_ccy="EUR"
> > Or
> > fxsen.buy="GBP",(fxsen.contract_rate-fxsen.settle_rate)*-fxsen.sell*fxsen.settle_rate,(fxsen.contract_rate-fxsen.settle_rate)*-fxsen.sell/fxsen.settle_rate)))
> > AS Gain_Loss
> >
> > Thanks for your help.
> > Regards,
> > John
> >

>
>
>

 
Reply With Quote
 
=?Utf-8?B?c3BhcnRhbm1iYQ==?=
Guest
Posts: n/a
 
      2nd Apr 2005
Duane and all,

I just had an idea. The query is returning the results I want so why not
dump the results into a table. Rather the table is permanent or temporary,
and then run the report from this table. What do you think? Does Access
support temporary tables? I would just use SQL syntax to create the table,
and drop it if it is not temporary.

Apologies for all the questions, but I don't know of a good Access resource.
Any ideas about a resource would be appreciated.

Best,
John

"spartanmba" wrote:

> Duane,
>
> I tried wrapping the Iif() like you said in the query, but I still get the
> same error message from the report. Thanks for your help.
>
> John
>
> "Duane Hookom" wrote:
>
> > You might try wrap the entire IIf(.....) in Val( IIf(.....) )
> >
> > --
> > Duane Hookom
> > MS Access MVP
> >
> >
> > "spartanmba" <(E-Mail Removed)> wrote in message
> > news:097C40F9-1AFE-4A71-9407-(E-Mail Removed)...
> > > Hello,
> > >
> > > I am using report wizard to build a report from a query. I receive an
> > > error
> > > when I have the report wizard sum the gain_loss column of my query. The
> > > syntax for the gain_loss column is below. The error reads, "The
> > > expression
> > > is typed incorrectly, or it is too complex to be evaluated. For example,
> > > a
> > > numeric expression may contain too many complicated elements. Try
> > > simplifying the expression by assinging parts of the expression to
> > > variables." I can run the query wtihout any error, but I cannot get the
> > > repot wizard to sum the column. There is a nested if statement in my
> > > query.
> > > I am not sure what to do. I am very new to Access.
> > >
> > > IIf(fxsen.buy_CCY="USD",(IIf(fxsen.sell_ccy="EUR" Or
> > > fxsen.sell_ccy="GBP",(fxsen.settle_rate-fxsen.contract_rate)*fxsen.buy*fxsen.settle_rate,(fxsen.settle_rate-fxsen.contract_rate)*fxsen.buy/fxsen.settle_rate)),(IIf(fxsen.buy_ccy="EUR"
> > > Or
> > > fxsen.buy="GBP",(fxsen.contract_rate-fxsen.settle_rate)*-fxsen.sell*fxsen.settle_rate,(fxsen.contract_rate-fxsen.settle_rate)*-fxsen.sell/fxsen.settle_rate)))
> > > AS Gain_Loss
> > >
> > > Thanks for your help.
> > > Regards,
> > > John
> > >

> >
> >
> >

 
Reply With Quote
 
Larry Linson
Guest
Posts: n/a
 
      3rd Apr 2005
"spartanmba" wrote

> Rather the table is permanent or temporary,
> and then run the report from this table. What
> do you think? Does Access support
> temporary tables?


Not in the sense that SQL Server does, but you can use a Make Table Query to
create a new table. The best way to do that, so you don't suffer database
bloat, is to create the temporary table inside a temporary database... when
you are done with it you can use the Kill statement to delete the temporary
database. There is an example at MVP Tony Toews' site,
http://www.granite.ab.ca/accsmstr.htm.

Larry Linson
Microsoft Access MVP


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Next Build Shall be RTM guys not any other builds unless MS decides to do one more build because of bugs before RTM RC2 build 5477 is the last build before RTM Drew Windows Vista General Discussion 8 13th Oct 2006 12:41 AM
I meant RC2 Build 5744 is the last build unless ms find more bugs before the RTM build and gold version there only make another build if there more bugs and not ready for RTM Drew Windows Vista General Discussion 4 12th Oct 2006 02:17 PM
SWsoft Acronis Disk Director Suite 9.0 Build 508, Acronis OS Selector 8.0 Build 917, Acronis Partition Expert 2003 Build 292, Acronis Power Utilities 2004 Build 502, F-SECURE.ANTI vIRUS.PROXY v1.10.17.WINALL, F-SECURE.ANTI vIRUS v5.50.10260 for CITRI vvcd Storage Devices 2 4th Dec 2005 12:46 PM
SWsoft Acronis Disk Director Suite 9.0 Build 508, Acronis OS Selector 8.0 Build 917, Acronis Partition Expert 2003 Build 292, Acronis Power Utilities 2004 Build 502, F-SECURE.ANTI vIRUS.PROXY v1.10.17.WINALL, F-SECURE.ANTI vIRUS v5.50.10260 for CITRI code_fu Anti-Virus 2 2nd Oct 2004 09:32 AM
SWsoft Acronis Disk Director Suite 9.0 Build 508, Acronis OS Selector 8.0 Build 917, Acronis Partition Expert 2003 Build 292, Acronis Power Utilities 2004 Build 502, F-SECURE.ANTI vIRUS.PROXY v1.10.17.WINALL, F-SECURE.ANTI vIRUS v5.50.10260 for CITRI code_fu Windows XP Basics 0 2nd Oct 2004 05:11 AM


Features
 

Advertising
 

Newsgroups
 


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