473,804 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convert Text Field to Integer and do JOIN in he same Query

77 New Member
Please help....

I am trying to JOIN two tables, Table1 and Table2,
the fields used for the JOIN are Table1.CaseNum (Number field) and Table2.Casetxt (Text field).
I know it will not let me do the JOIN between Number field and Text field and for that I should have a query to do the Text to Integer conversion before I try the JOIN Query.

I would like to know if the following is possible
I want to do 2 things in the same Query,
1) convert the Text field to Integer and then
2) JOIN Table1.CaseNum and Table2.CaseTxt( converted to Integer)

Thanks in advance.
Dec 13 '07 #1
3 4508
Rabbit
12,516 Recognized Expert Moderator MVP
It might work if you do the conversion using a subquery in the FROM clause rather than in the main query.
Dec 13 '07 #2
AccessHunter
77 New Member
Thanks for your reply.

In the query I gave the criteria for Table1.CaseNum as, =Int([Table2.CaseTxt]), and it worked. It did the conversion and the JOIN without actually drawing a line to join the 2 tables.

Thanks again for your reply.
Dec 14 '07 #3
Rabbit
12,516 Recognized Expert Moderator MVP
Good luck.
Dec 14 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
32786
by: sara | last post by:
I have a mess on my hands. I have a whole set of queries and reports (almost a whole app, really) that has "location" as a text field. Sometimes it's a number and a few times it's text (001, 002, and ADV, TRN, MER). I now have to link on "LocationCode" (text)and "StoreNum" (numeric - from the other application - all numeric). I want the query to put the values for 001 from the numeric side with the values for 001 from the text side,...
13
3704
by: Ennio-Sr | last post by:
Hi all! After a very long struggle I finally succeded in transferring my old *.dbf file and the relating *.dbt (alias memo fields) to a pg table. For the time being I put the memo field in a separate table having two fields only (i.e.: n_memo integer, memo text) which can be related to the main table in a view.
4
2564
by: Blake D. | last post by:
I have two tables (tblClients and tblEmployees). Field in tblClient uses the PK of tblEmployee as a lookup. Currently, the PK is a text field containing the person's name. I want to add a ReplicationID field, and make that the PK. I then need to change the Counselor field in tblClient to store the ReplicationID but show the Name, and not lose any data in the process.
5
27688
by: 2redline | last post by:
I am trying to write a query in access that will pull results that are in the database in a text field and convert to where I can get a average including decimals. Any Ideas? -----------------------Start SQL-------------------------------------- SELECT AVG(CAST(dbo_sur_response_answer.answer_text AS int)) AS avg_correct FROM (dbo_sur_response_answer INNER JOIN dbo_sur_subitem
14
1829
by: John Welch | last post by:
Hi all. I'm creating a FE/BE database that will be used by about 6 users. As usual, I have several fields, such as "OrganizationTypeID" that will get values (via combo boxes in forms) from separate lookup tables. I know the 'correct' way to do this, using a long integer as the field type. In this case, however, I am considering doing it "incorrectly", by actually storing the text in my field rather than an ID, still using a lookup table,...
9
3140
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to be inserted into a standard web address in the table (the filed name is link) in ddw1 Example address ---
1
1591
by: AccessHunter | last post by:
Please Help.... I have a query with 2 tables, LegalFile and Cases. LegalFile has the field CaseID(Number Field) and Cases has CaseNbr(Text Field). I am trying to find entries that are in Legalfile but not in Cases. In order to club the conversion and join in one query I has the criteria for LegalFile.CaseID set to Int(). With this setup if I run the query it gives me all entries that are common in LegalFile and Cases. I tried setting...
2
2689
by: TroutmansRegistrar | last post by:
I have a web programming task that has me stumped. I hope that one of you could give me some insight or might know someone who could guide me in the right direction. This is the final piece of the web application that my employer wanted finished by January 1st. Perhaps my biggest problem is that I can’t seem to formulate the right search-engine search question to find the utility I need nor can I find any reference to the real issue. In...
0
2730
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only, cannot serch by combine 3 table) Example I have the query table below, how do I make the code to seach based on the query from this: SELECT Product.ID, Product.Description, Quantity.Quantity, Quantity.SeialNo, Quantity.SupplierID,...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10604
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9177
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6870
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3837
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3005
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.