Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB9.0 VB VB.NET
Hi,
 
I have a reportviewer report with the following expression:
 
 IIf([Number of A Levels]>3,(([UCAS Points]/3)*([Number of A Levels]-(1-(1/[Number of A Levels]))))/[Number of A Levels],[UCAS Points]/[Number of A Levels]) AS [Weighted Average]
 
I need to use the results from [Weighted Average] or wite a similar function in the form code to sort the report. Please note that I use tableadapters and datasets.
 
With the above code I get function arguments: '>' not recognized.
 

Any help would be appreciated.
 
Regards,
Posted 4-Feb-11 5:32am
Edited 4-Feb-11 6:25am
v2
Comments
Sandeep Mewara at 4-Feb-11 11:49am
   
Looks like you keep deleting you question and repost it. Why so?
Schalk Munnik at 4-Feb-11 11:52am
   
The last delete I thought I had the solution - unfortunately I do not :)
Sandeep Mewara at 4-Feb-11 11:54am
   
It's ok, you don't need to delete the questions. How would others know what was already discussed/suggested.
Schalk Munnik at 4-Feb-11 11:56am
   
OK sorry - will leave it in future
Dwayne J. Baldwin at 8-Feb-11 3:34am
   
Is this part of a sql command or an expression? Usually expressions are something like =Fields!FieldName.Value and the AS appears to be a column

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
Please try following might be helpful.
 
Dim dr As DataRow
       Dim WeightedAverage As Integer = IIf( Convert.ToInt32(dr("Number of A Levels"))>3,((Convert.ToInt32(dr("UCAS Points")/3)*(Convert.ToInt32(dr("Number of A Levels")-(1-(1/Convert.ToInt32(dr("Number of A Levels")))))/Convert.ToInt32(dr("Number of A Levels"),Convert.ToInt32(dr("UCAS Points")/Convert.ToInt32(dr("Number of A Levels"))
 
i have use dr that will be value of your Data Set current Row.
 
Thanks,
Imdadhusen
  Permalink  
Comments
CPallini at 9-Feb-11 9:13am
   
[Carlo on behalf of Shalk Munnik] Hi Imdadhusen,
 
I will try the code and get back to - thansk for your help.
 
Regards,
 
Schalk

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 400
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 DamithSL 95
4 Garth J Lancaster 90
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,032
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,220


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 9 Feb 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100