Help me with the query

let say, i have a table tblMain
THe table has following fields:
Rec#          num
Name         text
Account     text
Zip             text
the query retrieves all from the table:
select Rec# ,Name,Account,Zip        from tblMain
 At some point i link the table to another table tblAccount
tblAccount has many fields, and one of them is AccountNum which has a datatype number
how to convert the datatype so called "on fly" to number

------------>select Rec# ,Name,convertonumber(Account,) Zip        from tblMain
something like this
rfedorovAsked:
Who is Participating?
 
Paul JacksonSoftware EngineerCommented:
Select Rec#, Name, VAL(Account) As Account, Zip from tblMain
0
 
SharathData EngineerCommented:
You mean this?
select Rec# ,Name,cast(Account as number) Zip        from tblMain

Open in new window

0
 
rfedorovAuthor Commented:
something like this, just to make sure is for ms access?
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
rfedorovAuthor Commented:
The CAST and CONVERT column functions do not seem to work in MS Access. How can I convert a text column to an integer (number) column?

0
 
SharathData EngineerCommented:
try CINT.

select Rec# ,Name,CINT(Account), Zip        from tblMain
0
 
rfedorovAuthor Commented:
TO jacko72: WORKS GREAT

I USED the val () in where part of the query and everything works!!!

THANK YOU EVERYBODY
Could you also look at my another querstion?

ID:27026674
help me with ms box in ms access 2010
05/09/11 08:50 AM, ID: 27026674 | Points: 500
help me with ms box in ms access 2010
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.