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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Invalid Syntax



 
 
Thread Tools Display Modes
  #1  
Old May 23rd, 2007, 09:53 PM posted to microsoft.public.access.gettingstarted
Andre Adams
external usenet poster
 
Posts: 116
Default Invalid Syntax

Hello again...

This is my third question in 2 days and I've not gotten a response to them,
so what'll I do? I'll just keep on trying! Really want to learn this system!

I'm trying to finish a report that I've worked so hard on. I have a field
called "Execution" within my report that is only calculated when the
"Blotter" field shows with 16 or 66. Here's the problem. I do not have the
Execution field in my table, it's generated only in the report. How can I
tell the report to only calculate (Quantity * -.005625) only when those two
"Blotter" fields show ion a record in the table (But relating to the report)?
  #2  
Old May 23rd, 2007, 10:00 PM posted to microsoft.public.access.gettingstarted
Klatuu
external usenet poster
 
Posts: 7,074
Default Invalid Syntax

Part of the problem is your question is not clear, you talk about different
blotter fields and different values. Can you reword your question and add
more detail?
--
Dave Hargis, Microsoft Access MVP


"Andre Adams" wrote:

Hello again...

This is my third question in 2 days and I've not gotten a response to them,
so what'll I do? I'll just keep on trying! Really want to learn this system!

I'm trying to finish a report that I've worked so hard on. I have a field
called "Execution" within my report that is only calculated when the
"Blotter" field shows with 16 or 66. Here's the problem. I do not have the
Execution field in my table, it's generated only in the report. How can I
tell the report to only calculate (Quantity * -.005625) only when those two
"Blotter" fields show ion a record in the table (But relating to the report)?

  #3  
Old May 24th, 2007, 02:57 AM posted to microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Invalid Syntax

On Wed, 23 May 2007 13:53:00 -0700, Andre Adams
wrote:

Hello again...

This is my third question in 2 days and I've not gotten a response to them,
so what'll I do? I'll just keep on trying! Really want to learn this system!

I'm trying to finish a report that I've worked so hard on. I have a field
called "Execution" within my report that is only calculated when the
"Blotter" field shows with 16 or 66. Here's the problem. I do not have the
Execution field in my table, it's generated only in the report. How can I
tell the report to only calculate (Quantity * -.005625) only when those two
"Blotter" fields show ion a record in the table (But relating to the report)?


Andre, we cannot see your computer. We have NO way to know what your table
structure is, what "Execution" might be, what Blotter is, or what the
recordsource of your Report might be.

At a wild guess in the dark, you might be able to base the Report on a query
with a calculated field. In a vacant Field cell type

Execution: IIF([Blotter] IN (16, 66), [Quantity] * -.005625, Null)

and include a textbox bound to this field in your report.

John W. Vinson [MVP]
  #4  
Old May 24th, 2007, 03:38 PM posted to microsoft.public.access.gettingstarted
Andre Adams
external usenet poster
 
Posts: 116
Default Invalid Syntax

Hello John,

Thanks for the response.

My table Structure is as follows:

Shares
Trade Price
Commission Amount
Blotter

The "Execution" field isn't listed in my Table. It's one of the fields that
will not come over in my import from Excel. Thus, I need to calculate this
directly in Access. I do understand now that I cannot create the formula
directly into the report, I have to go back to the query to create it. I
guess my question is, what is the formula to create the Execution fee (Shares
* -.005425, if Blotter = 16 or 66)? What's given is the shares and the
blotter is shown on all trades. Hope this helps!

Andre Adams


"John W. Vinson" wrote:

On Wed, 23 May 2007 13:53:00 -0700, Andre Adams
wrote:

Hello again...

This is my third question in 2 days and I've not gotten a response to them,
so what'll I do? I'll just keep on trying! Really want to learn this system!

I'm trying to finish a report that I've worked so hard on. I have a field
called "Execution" within my report that is only calculated when the
"Blotter" field shows with 16 or 66. Here's the problem. I do not have the
Execution field in my table, it's generated only in the report. How can I
tell the report to only calculate (Quantity * -.005625) only when those two
"Blotter" fields show ion a record in the table (But relating to the report)?


Andre, we cannot see your computer. We have NO way to know what your table
structure is, what "Execution" might be, what Blotter is, or what the
recordsource of your Report might be.

At a wild guess in the dark, you might be able to base the Report on a query
with a calculated field. In a vacant Field cell type

Execution: IIF([Blotter] IN (16, 66), [Quantity] * -.005625, Null)

and include a textbox bound to this field in your report.

John W. Vinson [MVP]

  #5  
Old May 24th, 2007, 05:50 PM posted to microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Invalid Syntax

On Thu, 24 May 2007 07:38:03 -0700, Andre Adams
wrote:

Hello John,

Thanks for the response.

My table Structure is as follows:

Shares
Trade Price
Commission Amount
Blotter

The "Execution" field isn't listed in my Table. It's one of the fields that
will not come over in my import from Excel. Thus, I need to calculate this
directly in Access. I do understand now that I cannot create the formula
directly into the report, I have to go back to the query to create it. I
guess my question is, what is the formula to create the Execution fee (Shares
* -.005425, if Blotter = 16 or 66)? What's given is the shares and the
blotter is shown on all trades. Hope this helps!


Create a new Query based on your table.

In a vacant Field cell type what I suggested (rather too briefly!) in my
previous post:

Execution: IIF([Blotter] IN (16, 66), [Shares] * -.005625, Null)

This will create a calculated field named Execution; if the value of the field
named Blotter is 16 or 66, it will return the calculated value. If Blotter has
any other value (or no value at all) it will return a null (blank) result.

You can then base your Report on this query.

John W. Vinson [MVP]
  #6  
Old May 24th, 2007, 06:34 PM posted to microsoft.public.access.gettingstarted
Andre Adams
external usenet poster
 
Posts: 116
Default Invalid Syntax

Hey John,

Thanks for you prompt response!

I've tried your suggestion and it's prompting and "Enter parameter value"
into the fold. I check the equation and it's entered exactly the way that
you sent it to me, does this error mean that it can't be done within my
report?

Andre Adams

"John W. Vinson" wrote:

On Thu, 24 May 2007 07:38:03 -0700, Andre Adams
wrote:

Hello John,

Thanks for the response.

My table Structure is as follows:

Shares
Trade Price
Commission Amount
Blotter

The "Execution" field isn't listed in my Table. It's one of the fields that
will not come over in my import from Excel. Thus, I need to calculate this
directly in Access. I do understand now that I cannot create the formula
directly into the report, I have to go back to the query to create it. I
guess my question is, what is the formula to create the Execution fee (Shares
* -.005425, if Blotter = 16 or 66)? What's given is the shares and the
blotter is shown on all trades. Hope this helps!


Create a new Query based on your table.

In a vacant Field cell type what I suggested (rather too briefly!) in my
previous post:

Execution: IIF([Blotter] IN (16, 66), [Shares] * -.005625, Null)

This will create a calculated field named Execution; if the value of the field
named Blotter is 16 or 66, it will return the calculated value. If Blotter has
any other value (or no value at all) it will return a null (blank) result.

You can then base your Report on this query.

John W. Vinson [MVP]

  #7  
Old May 24th, 2007, 07:33 PM posted to microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Invalid Syntax

On Thu, 24 May 2007 10:34:02 -0700, Andre Adams
wrote:

Hey John,

Thanks for you prompt response!

I've tried your suggestion and it's prompting and "Enter parameter value"
into the fold. I check the equation and it's entered exactly the way that
you sent it to me, does this error mean that it can't be done within my
report?


No; it means you're making a mistake. Easy to do, you're working at two or
three different levels here!

Please open the Query. Select View... SQL. Copy and paste the SQL text to a
message here. Also post the parameter value that it's asking for, and the
Recordsource property of your Report.

John W. Vinson [MVP]
  #8  
Old May 24th, 2007, 07:48 PM posted to microsoft.public.access.gettingstarted
Andre Adams
external usenet poster
 
Posts: 116
Default Invalid Syntax

Here it is John,

SELECT tblTradeListingGroup1.RepID, tblTradeListingGroup1.[Acct #],
tblTradeListingGroup1.[Account Name], tblTradeListingGroup1.Symbol,
tblTradeListingGroup1.SettleDate, tblTradeListingGroup1.Tran,
tblTradeListingGroup1.[Shrs/Contr], tblTradeListingGroup1.TradePrice,
tblTradeListingGroup1.[Commission Amount], tblTradeListingGroup1.[Clearing
Charge], tblTradeListingGroup1.Bltr, [Execution] AS Expr1
FROM tblTradeListingGroup1
WHERE (((tblTradeListingGroup1.SettleDate)=[What Settlement Date do you wish
to view?]) AND (([Execution])=IIf([Bltr] In
(16,66),[Shrs/Contr]*-0.005425,Null)));

Also, the parameter value, it's asking me for one for the Execution. I have
no idea what you say when asking for the recordsource. Let me know where I
can find this information!

"John W. Vinson" wrote:

On Thu, 24 May 2007 10:34:02 -0700, Andre Adams
wrote:

Hey John,

Thanks for you prompt response!

I've tried your suggestion and it's prompting and "Enter parameter value"
into the fold. I check the equation and it's entered exactly the way that
you sent it to me, does this error mean that it can't be done within my
report?


No; it means you're making a mistake. Easy to do, you're working at two or
three different levels here!

Please open the Query. Select View... SQL. Copy and paste the SQL text to a
message here. Also post the parameter value that it's asking for, and the
Recordsource property of your Report.

John W. Vinson [MVP]

  #9  
Old May 24th, 2007, 08:00 PM posted to microsoft.public.access.gettingstarted
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default Invalid Syntax

(([Execution])=IIf([Bltr] In (16,66),[Shrs/Contr]*-0.005425,Null)));

won't work. You cannot use = Null when checking whether a value is Null or
not, you must use Is Null.

If what you're trying to do is add a computed field Execution to your query,
replace the

[Execution] AS Expr1

with

IIf([Bltr] In (16,66),[Shrs/Contr]*-0.005425,Null) AS Execution

(and remove the reference to Execution from the WHERE clause)



--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Andre Adams" wrote in message
...
Here it is John,

SELECT tblTradeListingGroup1.RepID, tblTradeListingGroup1.[Acct #],
tblTradeListingGroup1.[Account Name], tblTradeListingGroup1.Symbol,
tblTradeListingGroup1.SettleDate, tblTradeListingGroup1.Tran,
tblTradeListingGroup1.[Shrs/Contr], tblTradeListingGroup1.TradePrice,
tblTradeListingGroup1.[Commission Amount], tblTradeListingGroup1.[Clearing
Charge], tblTradeListingGroup1.Bltr, [Execution] AS Expr1
FROM tblTradeListingGroup1
WHERE (((tblTradeListingGroup1.SettleDate)=[What Settlement Date do you
wish
to view?]) AND (([Execution])=IIf([Bltr] In
(16,66),[Shrs/Contr]*-0.005425,Null)));

Also, the parameter value, it's asking me for one for the Execution. I
have
no idea what you say when asking for the recordsource. Let me know where
I
can find this information!

"John W. Vinson" wrote:

On Thu, 24 May 2007 10:34:02 -0700, Andre Adams
wrote:

Hey John,

Thanks for you prompt response!

I've tried your suggestion and it's prompting and "Enter parameter
value"
into the fold. I check the equation and it's entered exactly the way
that
you sent it to me, does this error mean that it can't be done within my
report?


No; it means you're making a mistake. Easy to do, you're working at two
or
three different levels here!

Please open the Query. Select View... SQL. Copy and paste the SQL text to
a
message here. Also post the parameter value that it's asking for, and the
Recordsource property of your Report.

John W. Vinson [MVP]



  #10  
Old May 24th, 2007, 08:50 PM posted to microsoft.public.access.gettingstarted
Andre Adams
external usenet poster
 
Posts: 116
Default Invalid Syntax

Thank you so much Mr. Douglas,

I no longer recieve the parameter check, but when the report comes up it
shows and #Error Message in all of the columns. Any reason why it would do
that?

Andre Adams

"Douglas J. Steele" wrote:

(([Execution])=IIf([Bltr] In (16,66),[Shrs/Contr]*-0.005425,Null)));

won't work. You cannot use = Null when checking whether a value is Null or
not, you must use Is Null.

If what you're trying to do is add a computed field Execution to your query,
replace the

[Execution] AS Expr1

with

IIf([Bltr] In (16,66),[Shrs/Contr]*-0.005425,Null) AS Execution

(and remove the reference to Execution from the WHERE clause)



--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Andre Adams" wrote in message
...
Here it is John,

SELECT tblTradeListingGroup1.RepID, tblTradeListingGroup1.[Acct #],
tblTradeListingGroup1.[Account Name], tblTradeListingGroup1.Symbol,
tblTradeListingGroup1.SettleDate, tblTradeListingGroup1.Tran,
tblTradeListingGroup1.[Shrs/Contr], tblTradeListingGroup1.TradePrice,
tblTradeListingGroup1.[Commission Amount], tblTradeListingGroup1.[Clearing
Charge], tblTradeListingGroup1.Bltr, [Execution] AS Expr1
FROM tblTradeListingGroup1
WHERE (((tblTradeListingGroup1.SettleDate)=[What Settlement Date do you
wish
to view?]) AND (([Execution])=IIf([Bltr] In
(16,66),[Shrs/Contr]*-0.005425,Null)));

Also, the parameter value, it's asking me for one for the Execution. I
have
no idea what you say when asking for the recordsource. Let me know where
I
can find this information!

"John W. Vinson" wrote:

On Thu, 24 May 2007 10:34:02 -0700, Andre Adams
wrote:

Hey John,

Thanks for you prompt response!

I've tried your suggestion and it's prompting and "Enter parameter
value"
into the fold. I check the equation and it's entered exactly the way
that
you sent it to me, does this error mean that it can't be done within my
report?

No; it means you're making a mistake. Easy to do, you're working at two
or
three different levels here!

Please open the Query. Select View... SQL. Copy and paste the SQL text to
a
message here. Also post the parameter value that it's asking for, and the
Recordsource property of your Report.

John W. Vinson [MVP]




 




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 10:49 AM.


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