Notifications
Clear all
Topic starter
Could I get some help on the code to show the last time a particular procedure code was ordered with the date? We could use 99211 for example. I would like to show this in a data display on a form.
Posted : June 25, 2015 1:55 am
try this:
SELECT x.code, x.description, x.orderdate
FROM (SELECT code, description, orderdate,
ROW_NUMBER() OVER (PARTITION BY code ORDER BY orderdate DESC) AS rank
FROM orders) x
WHERE x.rank= 1
Posted : June 25, 2015 4:33 am
Topic starter
COMPILER ERROR NEARBY: COMMA was unexpected after IDENTIFIER
Posted : June 25, 2015 6:10 am
You are probably going to have to use ORDERS_ALL("delimited") and put the results into an array. Loop through that array, finding all the relevant orders and then finding the most recent. Sahupala's answer was a SQL query and can't be used in a form.
Posted : June 30, 2015 7:59 am