Problem with SQL Statement inserting number formatted as double


I have a lat and long value that has been parsed as a string. This string has then been converted to a double.

    strLat = Mid(strReturnedData, 13, 18)
    intLat = CDbl(strLat)
    strLong = Mid(strReturnedData, 44, 19)
    intLong = CDbl(strLong)

So this leaves me with intLat and intLong which I want to insert in a table where Lat and Long is set as double

Next step is to insert the values into a table

DoCmd.RunSQL "INSERT INTO [Local_GeoCodes] ( lat, Long ) SELECT " & intLat & ", " & intLong & ""

However, when I run the statement it error saying syntax error in INSERT INTO statement

There are other fields in this table and if I run a statement to insert values into those there are no issues. Only when inserting the lat and long

If anyone has any ideas it would be much appreciated.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
try wrapping "Long" with square brackets and use this syntax

DoCmd.RunSQL "INSERT INTO [Local_GeoCodes] ( lat, [Long] ) Values(" & intLat & ", " & intLong & ")"

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
martmacAuthor Commented:
Perfect thanks so much. Sorry to be a pain, is Long reserved?
Yes, Long is a variable type that means a long integer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.