Link to home
Start Free TrialLog in
Avatar of Amour22015
Amour22015

asked on

MS Access Query - How to convert nvarchar to int

Hi experts,

I have a column
InvoiceNr it is a nvarchar data type

I am converting this into a int column

so something like:
CInt([InvoiceNR]) but that is for VBA

I am looking to do this using a Query

Please help and thanks...
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

CINT works in a query ...
Avatar of Amour22015
Amour22015

ASKER

But when I use that I get:
#Num!

Please help and thanks...
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Try:

cint(Nz(InvoiceNr))

or perhaps:

IIF(IsNumeric(InvoiceNr), Cint(InvoiceNr), '')
That works for this query thanks
You are welcome!

/gustav