- first possible issue I see is the non-ANSI group by where the 'acknowledgd' column shows up in the SELECT list but the 'brc_acknowledgd' column shows up in the GROUP BY clause; while this type of query is 'legal' in ASE it can cause unwanted/unexpected results; also, it's not apparent (to me) from your post if these are 2 different columns or if you've made a cut-n-paste/edit error; if there are 2 different columns then I would want to investigate the data in these 2 columns to see if they are what you expected; though ideally I'd want to rewrite the query to be ANSI compliant and therefore easier to understand/verify the results, eg:
select acknowledgd, no_record=count(*)
from MYTBLE
where acknowledgd > convert(char(8),getdate(),112)
group by acknowledgd
- you've mentioned that you run the current query at 18:00 and get the wrong results, but if you run the same query again at/around 18:00 (I'm assuming slightly after 18:00??) then you get the correct results; are you really running this query twice in (relatively) quick succession and getting different results?
- your first post seems to indicate that inserts/updates/deletes could be running at the time; could the 17:30 file processing still be running when you run your 18:00 query (eg, processing running late due to larger data set, or late start, or unexpected delays/blocking)? can you verify you don't have any other processing running at/near 18:00 that could be skewing your query results?
- do you *always* get the 'correct' results after running your query a 2nd time?
- is N3 the only count that ever comes up 'wrong', ie, N1/N2 are *always* correct? and does a subsequent run of the query always generate the 'correct' N3 value? if you answer 'yes' to both of these questions then I'm going to lean towards the following as a possible explanation: the 17:30 file processing is still running @ 18:00 thus leading to unexpected counts for N3 (ie, the expected 17:30 process counts), but a later run of the query provides a correct N3 value (because the 17:30 file processing has completed)