But Count ( * ) will return the number of records like you want, so I don't understand why you wouldn't use that.
Well, maybe I am just missing something, but how do I get a count returned AND the result? If I have an SQL statement that returns rows, how do I just add that count of # of rows returned?
I haven't tried it, but I've assumed that:
Select Count ( * ) , Field1, Field2 ... FROM
would put the count in the first column.
And if you want it separate from the data shown in the field, you could use:
Let ( [Results = ExecuteSQL( query goes here ) ;
$$Count = ValueCount ( Results )
Then you can put <<$$Count>> on your layout to show the record count in the results field.
Note: This assumes that you are using ¶ as the record separator.
Select Count ( * ) doesn't work.
The Let works, but the Merge Variable doesn't get updated when the query is run. It gets the right data, but it's not updating when the query is run. It's not optimal either, I really would like a field I can use after the query is run.
Yes, you'd need to use refresh window to see the merge variable update on your layout.
Otherwise, it looks like you should use two ExecuteSQL function calls, one with Count (*) and one without.
Hmmm, just brainstorming some more, but those two queries could be included in the same calculation such that the count is the first or last row of data shown in the field...