I have a lithology table with a components child, and a sample table with a lab results child. When I try to combine the components and lab results in one log column, I get repeated component descriptions every time that the lab test's depth doesn't match sample_depth. I can imagine that I could fix this problem by using a sophisticated sql query (or recreating the database without parent-child relationships), but is there an easy way to solve this?
Tried to get around this using sql in the text vs depth, but even very basic sql does not seem to behave (no data is returned) in this location. In the queries portion of input, I can usually get sql to do what I want, but something about its location inside the log stumps it.
Does your expression use the <<CompDescChild()>> function?
Also, if you can write an SQL statement to accomplish what you want, you can encapsulate that SQL into your expression in the report. The gINT Help file has some good pointers with examples about using SQL within an expression.
Apparently, the problem with the SQL was that <<PointID>> needs single quotes and <<Depth>> needs none. Since I can now get simple queries like
<<Sql(SELECT [LAB_DATA].[AASHTO] FROM [LAB_DATA] WHERE [LAB_DATA].[Depth] = <<Depth>> AND [LAB_DATA].[PointID] = '<<PointID>>')>>
to work, maybe I'll be able to build up to something more complicated.
I haven't tried to use <<CompDescChild()>> because its stated function is to bring in children of the components table. Since lab data is a child of sample, it doesn't seem applicable. Do you think there's a way to use it here?
I asked to find out if the <<CompDescChild()>> function was used instead of <<CompDesc()>>.
Without having seen the expression and report, the data being reported, or the component description format table(s), it is hard to make a recommendation. But it sounds like you're on the right track with your SQL.
I appreciate this post is from a long time ago but I spent hours and hours trying to figure out a very similar problem and got a solution - hoping this is appropriate and will serve as useful to other gINT users!I have a similar database structure, most of my tables are a child of 'POINT' but any test data gathered from a sample (so all lab testing) is in it's own table (PSD, MC, ATTER etc.) that is a child of the SAMPLE table. So similarly to Thomas' experience, when I used a component description in a depth text log item the data tables that were a child of 'SAMPLE' retriggered(??) the tables that are a child of 'POINT' whenever the depths were the same. So I would get double printing of the 'POINT' child data on my logs whenever lab data occurred at the same depth as anything with a 'POINT' parent (so double descriptions, details, etc. etc.). The solution to this seems to be using the Secondary Text setting! I split out my component description table into one that includes all the database fields from 'POINT' parent tables, this is my main text setting. Then I put all the database fields from 'SAMPLE' parent tables in the 2nd component description table and applied that to the Secondary Text setting. This seems to have done the trick, the data that's a child of 'POINT' no longer double prints!