Row Number in Access Query

stryker11
stryker11 used Ask the Experts™
on
Hi Experts

I'm trying to get row numbers for the query results using the Row_Number() Over function as shown below.  But I keep getting Syntax error (Missing Operator) in Access. Can someone highlight whats wrong with the Code:

SELECT (ROW_NUMBER() OVER (ORDER BY TableReg.RegId)) As Row,TableReg.RegName, TableReg.RegCompany, TableReg.EventId, TableReg.EventLong, TableReg.Status, TableReg.SubStatus, TableReg.RegId
FROM TableReg
WHERE (((TableReg.EventId)=[forms]![FormSheet]![EventId]) AND ((TableReg.Status)=[forms]![FrmNewBadge]![FullStatus] Or (TableReg.Status)=[forms]![FrmNewBadge]![Status]))
ORDER BY TableReg.RegCompany;

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

Commented:

Author

Commented:
But any suggestions on the SQL Statements?

Commented:
Can you please paste the exact error and line number of your error.
If you are trying to do this in Access then  Row_number() Over does not exist in Access/Jet SQL.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial