A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

change a text format to number format



 
 
Thread Tools Display Modes
  #1  
Old March 19th, 2010, 02:50 AM posted to microsoft.public.access
ferde
external usenet poster
 
Posts: 141
Default change a text format to number format

I need to link to someone elses table but they have used a different format
type for a field called ACCOUNT. I am a beginner and do not know how to
write SQL but I was wondering if it is possible to use an update query to
change a text field in this situation into a number format. I am trying to
run a mismatch query on this table with another table in my database that has
a field called ACCOUNT but my table has a number format. I am trying to come
up with a list of ACCOUNT numbers that are common in both tables.

Thank you in advance for any direction you can provide
  #2  
Old March 19th, 2010, 03:59 AM posted to microsoft.public.access
Kc-Mass
external usenet poster
 
Posts: 362
Default change a text format to number format

Let's say your account table is tblAccount2 and the one with the text
accounts is tblAccount1.

Create one query that converts your account field to text ( just in the
query not in the table).
Something like:
SELECT CStr([Account]) AS AccountAsText
FROM tblAccount2;

Then create a second query that joins the first query and tblAccount1.
Run the query and you have your answer.

SELECT tblAccount1.Account, qryToString.AccountAsText
FROM qryToString INNER JOIN tblAccount1 ON qryToString.AccountAsText =
tblAccount1.Account;

Regards

Kevin


"ferde" wrote in message
...
I need to link to someone elses table but they have used a different
format
type for a field called ACCOUNT. I am a beginner and do not know how to
write SQL but I was wondering if it is possible to use an update query to
change a text field in this situation into a number format. I am trying to
run a mismatch query on this table with another table in my database that
has
a field called ACCOUNT but my table has a number format. I am trying to
come
up with a list of ACCOUNT numbers that are common in both tables.

Thank you in advance for any direction you can provide



  #3  
Old March 19th, 2010, 04:09 AM posted to microsoft.public.access
Gina Whipp
external usenet poster
 
Posts: 3,500
Default change a text format to number format

ferde,

No, you can't change a fields Data Type by running an Update query. Try
creating a query with the linked table and for the field ACCOUNT put
(copy/paste)...

AccountNumber: Val([ACCOUNT])

....in the *Field:* part of the query replacing the ACCOUNT field.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"ferde" wrote in message
...
I need to link to someone elses table but they have used a different
format
type for a field called ACCOUNT. I am a beginner and do not know how to
write SQL but I was wondering if it is possible to use an update query to
change a text field in this situation into a number format. I am trying to
run a mismatch query on this table with another table in my database that
has
a field called ACCOUNT but my table has a number format. I am trying to
come
up with a list of ACCOUNT numbers that are common in both tables.

Thank you in advance for any direction you can provide

  #4  
Old March 19th, 2010, 04:36 AM posted to microsoft.public.access
ferde
external usenet poster
 
Posts: 141
Default change a text format to number format



"Gina Whipp" wrote:

ferde,

No, you can't change a fields Data Type by running an Update query. Try
creating a query with the linked table and for the field ACCOUNT put
(copy/paste)...

AccountNumber: Val([ACCOUNT])

...in the *Field:* part of the query replacing the ACCOUNT field.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"ferde" wrote in message
...
I need to link to someone elses table but they have used a different
format
type for a field called ACCOUNT. I am a beginner and do not know how to
write SQL but I was wondering if it is possible to use an update query to
change a text field in this situation into a number format. I am trying to
run a mismatch query on this table with another table in my database that
has
a field called ACCOUNT but my table has a number format. I am trying to
come
up with a list of ACCOUNT numbers that are common in both tables.

Thank you in advance for any direction you can provide

  #5  
Old March 19th, 2010, 04:37 AM posted to microsoft.public.access
ferde
external usenet poster
 
Posts: 141
Default change a text format to number format

Thank you so much...works great

"Gina Whipp" wrote:

ferde,

No, you can't change a fields Data Type by running an Update query. Try
creating a query with the linked table and for the field ACCOUNT put
(copy/paste)...

AccountNumber: Val([ACCOUNT])

...in the *Field:* part of the query replacing the ACCOUNT field.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"ferde" wrote in message
...
I need to link to someone elses table but they have used a different
format
type for a field called ACCOUNT. I am a beginner and do not know how to
write SQL but I was wondering if it is possible to use an update query to
change a text field in this situation into a number format. I am trying to
run a mismatch query on this table with another table in my database that
has
a field called ACCOUNT but my table has a number format. I am trying to
come
up with a list of ACCOUNT numbers that are common in both tables.

Thank you in advance for any direction you can provide

  #6  
Old March 19th, 2010, 08:31 PM posted to microsoft.public.access
Gina Whipp
external usenet poster
 
Posts: 3,500
Default change a text format to number format

You're welcome!

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"ferde" wrote in message
...
Thank you so much...works great

"Gina Whipp" wrote:

ferde,

No, you can't change a fields Data Type by running an Update query. Try
creating a query with the linked table and for the field ACCOUNT put
(copy/paste)...

AccountNumber: Val([ACCOUNT])

...in the *Field:* part of the query replacing the ACCOUNT field.

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

"ferde" wrote in message
...
I need to link to someone elses table but they have used a different
format
type for a field called ACCOUNT. I am a beginner and do not know how to
write SQL but I was wondering if it is possible to use an update query to
change a text field in this situation into a number format. I am trying to
run a mismatch query on this table with another table in my database that
has
a field called ACCOUNT but my table has a number format. I am trying to
come
up with a list of ACCOUNT numbers that are common in both tables.

Thank you in advance for any direction you can provide

  #7  
Old March 20th, 2010, 03:34 PM posted to microsoft.public.access
ferde
external usenet poster
 
Posts: 141
Default change a text format to number format

Thank you Keven this was very helpful.

"kc-mass" wrote:

Let's say your account table is tblAccount2 and the one with the text
accounts is tblAccount1.

Create one query that converts your account field to text ( just in the
query not in the table).
Something like:
SELECT CStr([Account]) AS AccountAsText
FROM tblAccount2;

Then create a second query that joins the first query and tblAccount1.
Run the query and you have your answer.

SELECT tblAccount1.Account, qryToString.AccountAsText
FROM qryToString INNER JOIN tblAccount1 ON qryToString.AccountAsText =
tblAccount1.Account;

Regards

Kevin


"ferde" wrote in message
...
I need to link to someone elses table but they have used a different
format
type for a field called ACCOUNT. I am a beginner and do not know how to
write SQL but I was wondering if it is possible to use an update query to
change a text field in this situation into a number format. I am trying to
run a mismatch query on this table with another table in my database that
has
a field called ACCOUNT but my table has a number format. I am trying to
come
up with a list of ACCOUNT numbers that are common in both tables.

Thank you in advance for any direction you can provide



.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.