Hi
I am writing an IF statement to extract max and min of the water depth from the monitoring record table.The monitoring table have some other gas monitoring related data however I am interested in filtering it by WDEP (water related monitoring) type record. I have written following line in the "depth expression" of discrete graphics Vs depth item.
<<IIf(_ (<<MOND.MOND_TYPE>>= "WDEP"),<<Min(<<MOND.MOND_RDNG>>)>>_ )>>
I have similar expression for maximum water in another discrete graphics Vs depth item.
Please can you guide me what is problem with above statement or this is not correct way to achieve my objective?
Thanks
This can be easily done using SQL,
<<Sql(_ SELECT MIN ([MOND].[MOND_RDNG]) _ From [MOND] _ Where [MOND].[PointID] = '<<PointID>>' _ AND [MOND].[MOND_TYPE] = "WDEP" _)>>
Do the same by replacing MIN with MAX.
Answer Verified By: Javied Iqbal
Many thanks for getting back.
I am checking it now.
Is it possible to create a loop in the above SELECT statement. I have two installation in some of the BHS (pipe 1 and pipe 2 and I want to show max & min discrete graphics Vs depth (water level symbol) for monitoring data from the both the pipes.
One way is to have two more discrete graphics vs depth (one for max and one for min) for pipe 1 (which have different records with names 01,MP1,1,pipe 1 !) and use the following SQL as per your advise:
<<Sql(_ SELECT MIN ([MOND].[MOND_RDNG]) _ From [MOND] _ Where [MOND].[PointID] = '<<PointID>>' _ AND [MOND].[MOND_TYPE] = "WDEP" _ AND ( [MONG].[PIPE_REF>] = "01" _ OR [MONG].[PIPE_REF>] = "MP1" _ OR [MONG].[PIPE_REF>] = "Pipe 1" _ OR [MONG].[PIPE_REF>] = "-" ) _ )>>
Is the above SQL statement is correct ? I put brackets around last AND statement for different pipe reference 01,MP1,Pipe 1 and - which are all representing pipe 1.
I think, [MONG].[PIPE_REF>] should be changed to [MONG].[PIPE_REF]