Help me with the query

Posted on 2011-05-11
Last Modified: 2012-05-11
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
Question by:rfedorov
    LVL 40

    Assisted Solution

    You mean this?
    select Rec# ,Name,cast(Account as number) Zip        from tblMain

    Open in new window


    Author Comment

    something like this, just to make sure is for ms access?

    Author Comment

    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?

    LVL 29

    Accepted Solution

    Select Rec#, Name, VAL(Account) As Account, Zip from tblMain
    LVL 40

    Expert Comment

    try CINT.

    select Rec# ,Name,CINT(Account), Zip        from tblMain

    Author Comment

    TO jacko72: WORKS GREAT

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

    Could you also look at my another querstion?

    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
    If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now