473,387 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

make table query specifics

Dear Experts,

I was was wondering if there was some way to specify output properties of a make table query. Specifically, I am haivng a problem with numbers being specified as text. while I realize I can go in and change the table properties after the table has been created, I create and replace this table quite often so that would become a laborious prcess. Is there some way I can make the query specify that for me. I am using access 2003 and the VBA script of the make talbe query is as follows:
Expand|Select|Wrap|Line Numbers
  1. SELECT Accounts.AccountNumber, Accounts.AccountName, Section1Budget.budgetedAmount, NZ([Section 1 Reappropriations]![budgetedAmount],0) AS Reappropriations, NZ(NZ([Section1Budget]![budgetedAmount])+NZ([Section 1 Reappropriations]![budgetedAmount]),0) AS [current appropriations], NZ([section1directPayVouchers]![SumOfAmount])+ NZ([Section1SPO]![SumOfAmount])+ NZ([Section1Requsitions]![SumOfAmount]) AS Encumbrances, NZ([current appropriations]-[Encumbrances],0) AS [budget afterencumbrances], NZ([appaidsection1]![SumOfAPPaidAmount],0) AS APPaid, NZ([current appropriations],0)-NZ([APPaid],0) AS [Expendable Funds] INTO section1report
  2. FROM Section1Budget RIGHT JOIN (Section1Requsitions RIGHT JOIN (section1directPayVouchers RIGHT JOIN ([Section 1 Reappropriations] RIGHT JOIN (appaidsection1 RIGHT JOIN (Accounts LEFT JOIN Section1SPO ON Accounts.AccountNumber = Section1SPO.AccountNumber) ON appaidsection1.AccountNumber1 = Accounts.AccountNumber) ON [Section 1 Reappropriations].[Account Number] = Accounts.AccountNumber) ON section1directPayVouchers.Account = Accounts.AccountNumber) ON Section1Requsitions.Account = Accounts.AccountNumber) ON Section1Budget.[Account Number] = Accounts.AccountNumber;
  3.  
any help you can give me would be greatly appreciated.

-Andy
Sep 19 '07 #1
5 1776
Scott Price
1,384 Expert 1GB
Dear Experts,

I was was wondering if there was some way to specify output properties of a make table query. Specifically, I am haivng a problem with numbers being specified as text. while I realize I can go in and change the table properties after the table has been created, I create and replace this table quite often so that would become a laborious prcess. Is there some way I can make the query specify that for me. I am using access 2003 and the VBA script of the make talbe query is as follows:

Expand|Select|Wrap|Line Numbers
  1. SELECT Accounts.AccountNumber, Accounts.AccountName, Section1Budget.budgetedAmount, NZ([Section 1 Reappropriations]![budgetedAmount],0) AS Reappropriations, NZ(NZ([Section1Budget]![budgetedAmount])+NZ([Section 1 Reappropriations]![budgetedAmount]),0) AS [current appropriations], NZ([section1directPayVouchers]![SumOfAmount])+ NZ([Section1SPO]![SumOfAmount])+ NZ([Section1Requsitions]![SumOfAmount]) AS Encumbrances, NZ([current appropriations]-[Encumbrances],0) AS [budget afterencumbrances], NZ([appaidsection1]![SumOfAPPaidAmount],0) AS APPaid, NZ([current appropriations],0)-NZ([APPaid],0) AS [Expendable Funds] INTO section1report
  2. FROM Section1Budget RIGHT JOIN (Section1Requsitions RIGHT JOIN (section1directPayVouchers RIGHT JOIN ([Section 1 Reappropriations] RIGHT JOIN (appaidsection1 RIGHT JOIN (Accounts LEFT JOIN Section1SPO ON Accounts.AccountNumber = Section1SPO.AccountNumber) ON appaidsection1.AccountNumber1 = Accounts.AccountNumber) ON [Section 1 Reappropriations].[Account Number] = Accounts.AccountNumber) ON section1directPayVouchers.Account = Accounts.AccountNumber) ON Section1Requsitions.Account = Accounts.AccountNumber) ON Section1Budget.[Account Number] = Accounts.AccountNumber;
any help you can give me would be greatly appreciated.

-Andy
Field names and data types are inherited from the source table in a make table query...

Are you saying that this isn't happening, and that instead some number data type fields are being transferred across into text fields? Which specific fields in the sql above is this happening with?

Regards,
Scott
Sep 20 '07 #2
Field names and data types are inherited from the source table in a make table query...

Are you saying that this isn't happening, and that instead some number data type fields are being transferred across into text fields? Which specific fields in the sql above is this happening with?

Regards,
Scott
It is happening to the appropriations field, reappropriaions field, budget after encumbrances, and APPaid
Sep 20 '07 #3
It is happening to the appropriations field, reappropriaions field, budget after encumbrances, and APPaid
and yeah... all the tables it works off of are all correct and represent the numbrs as numbers..... but for some reason when it translates into this query it turns the numbers into text fields
Sep 20 '07 #4
Scott Price
1,384 Expert 1GB
Strange... I'm not sure why it's doing it this way, when it should be inheriting the field attributes from your parent table.

There's no way that I know of to make an SQL make-table query reset the field attributes. To do this programmatically you'll need to explore the DAO tabledefs/indexes/fields/attributes collections.

Regards,
Scott
Sep 20 '07 #5
MMcCarthy
14,534 Expert Mod 8TB
Firstly you haven't specified the value if Null on many of the nz() functions. I think the default is "". This may be your problem. Try the following:

Expand|Select|Wrap|Line Numbers
  1. SELECT Accounts.AccountNumber, Accounts.AccountName, Section1Budget.budgetedAmount, NZ([Section 1 Reappropriations]![budgetedAmount],0) AS Reappropriations, NZ(NZ([Section1Budget]![budgetedAmount],0)+NZ([Section 1 Reappropriations]![budgetedAmount],0) AS [current appropriations], NZ([section1directPayVouchers]![SumOfAmount],0)+ NZ([Section1SPO]![SumOfAmount],0)+ NZ([Section1Requsitions]![SumOfAmount],0) AS Encumbrances, NZ([current appropriations]-[Encumbrances]),0) AS [budget afterencumbrances], NZ([appaidsection1]![SumOfAPPaidAmount],0) AS APPaid, NZ([current appropriations],0)-NZ([APPaid],0) AS [Expendable Funds] INTO section1report
  2. FROM Section1Budget RIGHT JOIN (Section1Requsitions RIGHT JOIN (section1directPayVouchers RIGHT JOIN ([Section 1 Reappropriations] RIGHT JOIN (appaidsection1 RIGHT JOIN (Accounts LEFT JOIN Section1SPO ON Accounts.AccountNumber = Section1SPO.AccountNumber) ON appaidsection1.AccountNumber1 = Accounts.AccountNumber) ON [Section 1 Reappropriations].[Account Number] = Accounts.AccountNumber) ON section1directPayVouchers.Account = Accounts.AccountNumber) ON Section1Requsitions.Account = Accounts.AccountNumber) ON Section1Budget.[Account Number] = Accounts.AccountNumber;
  3.  
If that doesn't work there is a CCur() function you can use around the calculations which should force the appropriate output.

CCur(NZ([Section 1 Reappropriations]![budgetedAmount],0)) AS Reappropriations
Sep 30 '07 #6

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

Similar topics

1
by: Bill | last post by:
I just discovered that all my records appear twice inside my table, in other words, they repeat on the row below. How can I delete all of the duplicates? I'm sure there must be a tidy line of sql...
2
by: Kathy Krizl | last post by:
I'm probably doing something stupid, but I have a make table query. One of the tables I reference has some check box fields in it. Their Data Type is Yes/No, their field property format is Yes/No,...
0
by: LesM | last post by:
This is a change of behaviour between Access 2000 SP3 and Access 2002 SP3. I have Progress table that is linked via ODBC into Access using OpenLink Lite for Progress 9.0b. For over a year, using...
24
by: Bob Alston | last post by:
Anyone know a way to make all access to a linked table, in another Access MDB, read only? I really don't want all the hassle of implementing full access security. I can't do this at the server...
26
by: Daron | last post by:
How do I sort a table, from a form. I can't use SQL! WE have an Access application that is created by an outside vendor. The one form states: "Please make sure all records in table are sorted by...
4
by: ken | last post by:
Hi, I use this command to run a make table query without opening it... CurrentDb.Execute "make table query name" Access tells me that it can't execute a select query...? Its a make table query...
3
by: otac0n | last post by:
How can I select the maximum value from a field, but make sure that the value i want stays greater than a cetrain value? I currently have this: SELECT A.rating, B.rating,...
8
by: narpet | last post by:
Hello all. I have a table in Access that has a check box as one of the fields. I want to write a query or code that will check or uncheck that box based on conditions met by other fields in the...
3
by: Robertf987 | last post by:
Hi, I'm a bit stuck with an access database. I'm using access 2000 if that's any help. Right, it's 3:40am right now and I'm rather tired, but I *hope* this makes sense. I have a table which...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.