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...
Microsoft AccessVBASQL

Avatar of undefined
Last Comment
Gustav Brock

8/22/2022 - Mon
Scott McDaniel (EE MVE )

CINT works in a query ...
Amour22015

ASKER
But when I use that I get:
#Num!

Please help and thanks...
ASKER CERTIFIED SOLUTION
Gustav Brock

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Mike Eghtebas

Try:

cint(Nz(InvoiceNr))

or perhaps:

IIF(IsNumeric(InvoiceNr), Cint(InvoiceNr), '')
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Amour22015

ASKER
That works for this query thanks
Gustav Brock

You are welcome!

/gustav