On my Form, I want to have a query look at one specific field for a number (1). If the number is found then I would like to have the query do basic subtraction on two other fields. (one from each table)
What I have so far is one unbound text box with the following,
=IIf(tblDaStrategy!DaNumber=1,(tblDaStrategy!DaTar get-tblDaReport!DaActual1))
Simply put, if one field has the number one in it, then take the other two fields and subtract (ex. 100-75) to display 25.
It's not working. I keep getting the #Name?
Update: I think I got it. I went back to square one and made a master query that contains the data from both tables. Then I bound one of the forms to the query. I updated my IIF statement and poof. It seems to be working. Now, where's the Asprin and my pillow?
Update 2: Bummer, now my magical 25 is in place but now my form is locked tight. Guess I need to consider abandoning this concept and simply producing a report with the 25 on it. Unless someone out there has a better idea.
I have a table called tblAccounts and a form called frmEnter_new_accounts. In my frmEnter_New_Accounts form is a Text Box for Account #. I want to have it so that when the user enters an account # it checks the tblAccounts table for a duplicate account # and then displays a message box (or Pop-Up form) to tell the user that the Account Number entered already exists. I would also like that box to offer the user the option to either Close that form without saving or return to the form to reenter a different account #.
I know I would probably do this in the LostFocus event or BeforeUpdate.
Does anyone have any ideas or samle code to assist me in this adventure?
Tables join using fQSRegno. Scenario is Tbl Individual contains all the members info.Tbl Point contains point given to members who attend courses. Problem is when I created a query...
I want to make a button which when clicked will bring up a box which the user will enter a number which will then be subtracted from a number in a field.
I have tried an update query however not been able to getting it working.
Hi, I have a query with two fields. One has the "MEASUREMENT" and the second one is the month containing the values. In the MEASUREMENTs I have gross revenues and discounts, how can I create a new MEASUREMENT (net revenue) that is calculated by subtracting the discounts from the gross revenue.
Hi, I hope someone can help me out with this problem:
I have 2 tables with identical stucture, and no unique ID number. Both had identical data, and the databse was then copied onto 2 laptops. Now further data was added onto each.
I want to now merge the three databses (ie original one, and 2 laptops) into 1, without creating duplicates- so I need to identify which are the new fields added to the databases. I figured that by somehow subtracting the original table from the new ones, i would be left with the new data, but dont know how to do this. Or is their another way?
My employer uses a third party employee tracking system and I do back end work to massage the raw data for ad hoc reports using tables created by this third party software.
Is there a simple means to have a query compare Table A and Table B where Table A is a list of all jobs in a company - both filled and vacant - and Table B is a list of all employees in the company? The table containing jobs data has no field designating whether a job is filled or not. The only way to determine vacancies is to compare the two tables and select only those job numbers where there is no matching employee.
So, using examples from an earlier question - one that KeithG answered perfectly - let me see if I can demonstrate what I'm trying to do...
The Jobs table has two fields; JobNum and JobDesc. The Employee table has three fields; EmpNum, EmpName, JobNum.
Here's Table A, Jobs;
100, Boss 105, Aide 200, Manager 201, Worker 202, Worker
I have a report based on a query where I get results sorted by month after i have chosen 'from date' and 'to date' in the beginning. I also want a set number for each month to be subtracted from the total sum, and then added to the next month (even if it is a negative number). Ex. Total in january is 100, then it is supposed to subtract 50 from that number, report the result of 50 in one own field at the end of january, then send this to february where the total sum is ex. 200, then the total sum for february is supposed to be 250, and then again a different number, like 60 is automaticly subtracted from the total sum and displayed in one field as the result 190. And so on.. Does anyone know if this is possible, and how? I am a noob, both in access and in the english language :P
4/11/2007 1:01:28 AM 4/12/2007 2:02:52 AM 4/13/2007 4:21:30 AM 4/14/2007 2:22:21 AM 4/15/2007 3:34:53 AM 4/16/2007 4:02:37 AM 4/17/2007 5:03:15 AM 4/18/2007 7:17:34 AM
I need helps again How can I subtract 7 hour from the query
I'm sure this is simple but my brain is mushy this morning!
I have two datetime fields ADMISSION and DISCHARGE with values such as 03/02/2008 15:00. How do I convert these to dates only? I don't want to just *format* them as dates, which I can do. In this example I would want to convert that date to 03/02/2008 (or 03/02/2008 00:00)
It's an idiosyncrasy of the way the NHS calculates hospital length of stay. Our previous IT system had dates and times in separate fields so I could just ignore the time field and work out length of stay based on dates only. However, our new system returns a combined datetime.
Patient A 03/02/2008 00:15 to 03/02/2008 23:45 = 0 days but Patient B 03/02/2008 23:45 to 04/02/2008 00:15 = 1 day
Basically, you count a day if there's a date change, even if that was only half an hour (or even a few minutes) either side of midnight, but you DON'T count a day if there was no date change, even if that was almost 24 hours.
So formatting them as dd/mm/yyyy wont work ,as I will still have partial days when I subtract one from the other and INT([DISCHARGE]-[ADMISSION]) wont always work either as it would calculate 0 for patient B.
I have a table that has two fields; odometer reading and reading date. I want to able input the reading dates along with the odometer readings. Then I want my query to calculate the milage difference between each date.
I have two date fields. I want to subtract them to determine the number of days elapsed. The dates are in the following format: Dateserial (Year, Month, Day). When I subtract them I get 7670 as the result when the number should be 365 if they are a year apart. How can I subtract the dates in a query?
In my database I have a list of organizations with a certain goal. If that organization can not hit that goal we have to "reallocate" the left over goal to another organization. As it stands now I have the following fields, Goal (which should stay stagnant), change (to either subtract from one organization and add to another) and New. What I would like to do is have a way to have a way to calculate if there is a change to maybe have a drop drown that when the change is subtracted I can add that to "new" of another organization.
I've got a table in which some records are associated with a number (numeric field): 691, 692, 693 etc. My parameter query asks for the number I'm looking for (parameter) and should return all records associated with that number or with that number minus one.
Something like this: enter parameter find records
in which number = parameter OR in which number = (parameter - 1)
I wish to create a query that produces a return of the previous month and year. i.e.
25/03/2015 (though a query formula) becomes Feb-15 01/01/2000 would return DEC-99 etc
This way I can then link all of my February data (formatted "mmm-yy" to my [datefield1]
I have tried subtracting day and formatting to months and subtracting then the value of a month but it all becomes too complicated because of the different days in the months and Jan to Dec and year as well.
I got a form with a field called [copies on hand] so i made a command button and when i click the button, i want the value in the field [copies on hand] to be subtracted by one.....
The code i have thats not working is
Private Sub Command 25_Click() If [copies_on_hand] >0 Then [copies_on_hand] = ([copies_on_hand]-1) End Sub
Hi, I am very new to access. I have designed a db for my employer, but I can't figure out how to subtract one field from another without having it subtract fom all others. My employer is a counselor and wants to know how many units are left per client. There are several diffent services available per client. (88K, 86H, 81H, ect) For instance I tried to use a query, but when it was subtracting (number of units)-(number of used) It subtracted from all the different service types. Then I tried to do it on the form and all I get is #Name? I can email you a copy of the database with a mock client if i'm not explaing myself enough. I know it's probably something very simple and I would appreciate any help. Also, if you know of any good books or websites where I can learn more I'd appreciate the info. I'm learning from Access 2002 Bible.
Here's a sticky one? (maybe...) I have a number of aggregate totals from several queries all linked to the Input Query and all Nz'd as 0's
From the image enclosed the totaling text box (top right left) is calculating the value in the properties box. The value should be 3.52 + 5 - 8 = 0.52 the value showing is -4.475 (which is 3.52 - 8) so I see it's ignoring the 5 value but I can't see why.
The ACDays and ALDays values are both generated by the same module, but with different Leave types. and as I mentioned previously all Nz 0'd