Jump to content
  • 0
Sign in to follow this  
theconav

Sql Error

Question

Hello all,

 

I ve been trying to solve this issue for quite so e time now:

 

Field : FieldOne --> Text

Fied  : FieldTwo --> Number

 

Field : Ttl --> Calculated

 

I have the following SQL in the calculated field:

 

SELECT Sum(FieldTwo) From tTable_Name WHERE tTable_Name_Field = '[@field:FieldOne]'

 

However I do not get nay results.

 

I have tried also the following alternative

 

SELECT Sum(FieldTwo) From tTable_Name WHERE tTable_Name_Field = [@field:FieldOne]

 

This gives me the sum of FieldTwo, however ignoring the criteria set by the WHERE.

 

If I try SELECT Sum(FieldTwo) From tTable_Name WHERE tTable_Name_Field = 'XXX' (i.e. passing a specific value instead of whatever value [@field:FieldOne] carries), then it works fine. 

 

Could someone help please ?

 

Thank you

 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello,

Try adding IsNull on the field inside the Sum.

SELECT Sum(IsNull(FieldTwo,0)) From tTable_Name WHERE tTable_Name_Field = '[@field:FieldOne]'

 

EDIT: I didn't noticed the date. I reported this post. Sorry. I saw this thread at the top where the unanswered threads are located.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...