UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Using a qry to extract info from a table name to a field    
 
   
MCK
post Feb 5 2007, 03:37 PM
Post #1

New Member
Posts: 1



I am trying to run a query that allows me to take the right 6 characters of the table name and insert them into a field within the table.
Go to the top of the page
 
+
Doug Steele
post Feb 5 2007, 03:47 PM
Post #2

UtterAccess VIP
Posts: 17,797
From: Don Mills, ON (Canada)



You're going to have to hard-code the 6 characters: I don't believe there's any way in a query to get access to the table's name.
Go to the top of the page
 
+
doctor9
post Feb 5 2007, 04:02 PM
Post #3

UtterAccess VIP
Posts: 9,430
From: Wisconsin



This query will give you the list of table names:

SELECT MSysObjects.Name AS nm, MSysObjects.Database
FROM MSysObjects
WHERE (((MSysObjects.Database) Is Not Null));

It also lists the path/name of the database file that the table resides in. I use it to manage tables linked from multiple databases.

Dennis
Go to the top of the page
 
+
Doug Steele
post Feb 5 2007, 04:58 PM
Post #4

UtterAccess VIP
Posts: 17,797
From: Don Mills, ON (Canada)



While you can get the information about the tables in an application from MSysObjects, I don't think that's what MCK is looking for.

I'm assuming he/she wants to be able to put the last 6 characters of a particular table as a field in that table.
Go to the top of the page
 
+
doctor9
post Feb 5 2007, 05:11 PM
Post #5

UtterAccess VIP
Posts: 9,430
From: Wisconsin



MCK,

Firstly, welcome to UtterAccess! (Um, a little belated, I admit.)

Secondly, can you be more specific about what you are doing with an example?

That way we can better help you accomplish your task.

Dennis
Go to the top of the page
 
+
truittb
post Feb 5 2007, 06:32 PM
Post #6

Retired Moderator
Posts: 13,544
From: Texas (Is there anywhere else?)



Welcome to Utter Access.

What you want to do begs the question why? Do you have multiple tables with the same structure? (IMG:http://www.utteraccess.com/forum/style_emoticons/default/confused.gif)

Let us know why you need to do what you are asking.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th June 2013 - 12:40 AM