Queries :: DSum Not Working After December In Financial Year

Apr 17, 2015

I have the following in a query:

Count: Val(DSum("Num","Google_export_1Cancer_Target_Prea" ,"DatePart('m',[StudyEntryDate])<=" & [AMonth] & " And DatePart('yyyy',[StudyEntryDate])<=" & [AYear]))

Our Financial Year runs from April to March.

The formula works fine up to, and including, December. Then, for the last three months of the financial year (Jan, Feb and Mar), the running total of the 'Num' field stops and the entry for January is just January's 'Num' with the running total starting again for February and March.

How do I rectify this?

View Replies


ADVERTISEMENT

Creating A Financial Year Query

Nov 1, 2006

I am trying to create a make table query that extracts information from another table based on its year and month.

The problem I am having occurs when it comes to selecting data across multiple years ie. April 2005 - March 2006. The table that contains the data has two fields that are year and month.

I have created a form to allow the user to enter the required years, but I am unsure how to get the query not to select duplicate months e.g. April 2005 and April 2006.:confused:

Any help would be appreciated.:)

View 12 Replies View Related

Financial (Fiscal) Year Field

Jan 25, 2007

I have created a query in Access 2000 which contains a date field in short date format.

I would like to add a field to this query which calculates the financial (fiscal) year from my date field. Our financial year runs from Apr 1st to Mar 31st.

I'm totally stuck - any ideas would be greatly appreciated!!

View 3 Replies View Related

Tables :: Create A Table Which Would Include Financial Data By Year / Client

Nov 15, 2012

I am trying to create a table which would include financial data, by year, by client. For example:

Client #1

2009 2010 2011
Revenue 5000 10000 1200
Expenses 2000 1000 700
Net Income 3000 9000 500

Client #2

2009 2010 2011
Revenue 5000 10000 1200
Expenses 2000 1000 700
Net Income 3000 9000 500
Etc.

Should I have headers as such:

Client #, 2009Revenue, 2009Expenses, 2009NetIncome, 2010Revenue, 2010Expenses, 2010NetIncome, 2011Revenue, 2011Expenses, 2011NetIncome

View 6 Replies View Related

DSum Not Working Properly

Dec 8, 2006

I can't figure out what I have wrong in my code. I've searched all over the forums and the help files in Access. I'm sure it's something simple. Could someone please take a look?

=DSum([DefectQty],"d_sub1_DefectReport","CodeID= "" & [tblDefectCodes].[CodeID] & "" AND ""[InspectDate] >= #" & [Forms]![frmDefectDetailReport]![txtStartDate] & "#" And "[InspectDate] <= #" & [Forms]![frmDefectDetailReport]![txtEndDate] & "#")


I'm trying to get a sum of all defect quantities between a date range from a user form. Rather than summing all the defect quantities for a defect code, it's summing up the total quantites for each quantity. I'm sure that doesn't make sense so here's an example:

InspectDate CodeID DefectQty DSum Should Be
6/1/06 100 1 3 5
6/2/06 100 2 4 5
6/3/06 105 1 3 1
6/4/06 103 1 3 1
6/5/06 100 2 4 5


The domain is a query because the dates come from a different table than the defect quantities, so the query is pulling all the relevant data to be summed.

View 6 Replies View Related

Modules & VBA :: DSum Not Working On Subform

Nov 2, 2014

Every time i try to get info from a sub form or its table ,Things never sem to work.Is there something special you have to do for eg maybe going via the main form?I am trying to use dsum as an alternative to multiplying info in the sub form.This is the code

=DSum("SoldAtPrice*Quantity","[Order Details]","IDNewOrders=" & [OrderID FK]).

View 4 Replies View Related

Queries :: How To Determine Which Financial Month The Date Is

Jul 18, 2013

Using Access 2000

I have a field which lists a date. I would like to determine which financial month the date is.

However the financial month starts and ends at odd times, for example

The start time of the month is the first Sunday after the last Friday of each month. With the end date being the day before this.

So for July it would have been

30/06/2013 - 03/08/2013

and August is

04/08/2013 - 31/08/2013

I would like the output to show something like "July 2013"

How to do this?

View 4 Replies View Related

Queries :: Group Financial Data To One Main Table - Round To 2 Decimal Places

Feb 25, 2014

I have about ten append queries to group various financial data to one main table.

I have used the round function (iff (Round(Nz([FIN_data]),2)) in the queries to round the original data into 2 decimal places but there is still one or two lines exceeding 2 decimal places.

What is the better approach to have only 2 decimal places for all append data?

View 4 Replies View Related

Queries :: Determine Date Given Day Of Year And Year

Jul 3, 2014

I have fields [DayOfYear] and [Year] can I somehow produce the dd/mm/yyyy from this. I know how to do it in Excel but the Asscess function Date() is a little different.

I.e. if [DayOfYear] =152, [Year] = 2014 then [Date] = 2/6/2014

View 6 Replies View Related

Field Update Using DSUM: Field Joins Are Not Working Correctly

Sep 11, 2007

I know there are numerous threads regarding dsum() on the forum, but I wasn't able to find the exact answer to my problem.

The root of my problem is that I'm trying to update a field on a table using dsum, which references another query to update the table. Although I have all of the correct keys from the physical table joined to the query in the dsum function, the code/ms access seems to ignore the joins. As a result, all payees are having their "vol" field set instead of a select subset.

Query (GetTxnVolAmtTR"):

SELECT p.payee_id, sum(txn_volume) AS vol, t.market, t.period_id
FROM ft_payees AS p, ft_txn_summary AS t
WHERE p.payee_id=t.payee_id And p.market=t.market
GROUP BY t.payee_id, t.period_id, t.market, p.payee_id;


Update statement (references the query above):

UPDATE tmp_ft_component AS rc
SET rc.volume = Dsum("vol","GetTxnVolAmtTR","GetTxnVolAmtTR.payee_id= " & [rc.payee_id] And "GetTxnVolAmtTR.market= " & [rc.market] And "GetTxnVolAmtTR.period_id= " & [rc.period_id] & "")
WHERE rc.component_name='Total Revenue';

as you can see, I have all of the fields I want joined, but the code seems to ignore this. I've tried looking at this site: http://www.mvps.org/access/general/gen0018.htm , but haven't found my answer. Any help would be much appreciated!

View 3 Replies View Related

Queries :: DSum Always One Record Behind

Nov 18, 2013

I am using DSum to total some records located in a subform. I have code to save the value returned by DSum to a table on a lost focus event. It works great except for one thing. The value saved is always one record behind. The save code is:

Dim dbs As dao.Database
Dim rst As dao.Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblInvoice", dbOpenDynaset)
rst.FindFirst "ID = " & Forms!frmInvoice!txtID
With rst
.Edit
!Total = Forms!frmInvoice!txtTotal
.Update
End With
Exit Sub

txtTotal is the textbox containing the DSum value. It displays the proper value. If I insert a blank row the routine will finally pass the right value. I tried running the code from a button but it still copies the old total.

View 3 Replies View Related

Queries :: Can't DSUM In Query With Yes / No

Nov 17, 2014

I'm attempting to do a DSUM in a query against a linked table that has a field name of "VOID". The field name shows up as a yes/no when looking at the structure and when looking at the data, it is either 0 or -1. I've tried just about everything I can think of but this is the structure I have:

Tons: DSum("Net","dbo_tblSALESTKT","JOB='" & Left([JobNumber],6) & "' AND Ticket_Date=#" & [forms]![frmForemanInfo]![CurrentDate] & "# AND [dbo_tblSALESTKT]![VOID]=0")

If I remove the VOID part, it will sum correctly but when adding in the VOID=0 or false or No or anything, the query doesn't show me a sum anymore. what I'm doing wrong.

View 2 Replies View Related

Queries :: DSum Using Date Criteria

Jan 16, 2014

I have a query which includes a deposit field and a Transaction_Date field. I would like a cumulative deposit on each record (arranged according to date). The following is the expression I am using:

=DSum("[Deposit]","[myQuery]","[Transaction_Date]<=#" & [Transaction_Date] &"#")

I am getting completely nonsense values from the expression - some of the fields are blank (the first few fields) and then the values bear no relation to the deposits preceding them. I have tried all sorts of formats including using Format([Date], 'dd/mm/yyyy') on either side and then on both sides but with no effect.

View 4 Replies View Related

Queries :: DSum With Multiple Criteria?

May 15, 2014

I can't seem to get my head around an issue i'm having with a DSum, the statement is:

Code:
=DSum("[Amount Used]","[tbl_Rwk_Used]","[Cage Number]='" & [IBC_Number] & "'" And "[ID]=" & [ID])

I've tested both statements separately and they work ok, but as soon as I add the "AND" operator, the whole field is summed and the criteria thrown out of the window apparently.

[ID] Is the same in both tables and relates to a main record
[Cage Number] and [IBC_Number] are related in both tables, but are and are strings

View 2 Replies View Related

Queries :: DSum With Start And End Date

Oct 19, 2013

I am having a query showing customer as client, paid amount as pamount, billingdate, payment date as pdate.

I want to get dsum of pamount specific for each client with date criteria for example if i open query through form mentioning start and end date then the sum must vary as per the date given. the date is "billingdate" as mentioned above.

View 10 Replies View Related

Queries :: DSum With Dynamic Date Criteria

Jul 10, 2013

I need to do a DSum with criteria that picks up a previous month based on todays date, I have got the following but I don't know how to format the last part of the criteria.

If I take out the Month(DateAdd("m",-13,(Date()))) and replace it with 6 it works fine.

Code:
DSum("[invquan]","[qrySalesByStockCode]","[stcode] = '" & [stockcode] & "' and [Month] = Month(DateAdd("m",-13,(Date())))'")

View 1 Replies View Related

Queries :: DSum Does Not Recognize Dates In Criteria Box

Jul 9, 2013

I am trying to create a user-friendly database to enter invoice records (deductions and additions) for securities. I would like to be able to run queries with running totals from month to month inclusive (end total of one month = starting total of next month). I have already figured out how to create a running total; however, I have numerous "companies." Each record could be from any of 30 companies. When I add up the running total from say January 1 to February 28th, I get the additions and deductions of all the companies, not just the one I want. Inputting the companyID (example A110) in the query box only adjusts what is displayed, not the running totals that go by the total deductions from the records before that record (I assigned each record a "database ID" because dsum does not recognize dates in the criteria box, if I want to do a running sum.

I also was wondering if it would be possible to build forms with macros to create these queries in a user-friendly manner (so the company that I am interning for can create queries when they need them without me there).

View 12 Replies View Related

Queries :: Make DSum For Products Coming In And Out?

Nov 9, 2014

I am trying to make a dsum for products coming in and coming out. find the example below

Products In
Apple 10
Mango 5

Products out
Apple 5

Now I want to show statement for sum as follows

Product. In. Out. Net in hand
Apple. 10. 5. 5
Mango. 5. 0. 5

But it is showing only

Product. In. Out. Net in hand
Apple. 10. 5. 5

what I understand is dsum cannot find the out field for mango as there is no field found for mango

View 14 Replies View Related

Queries :: DSum - Count Of Each Time The Record Appears

Feb 26, 2014

I'm trying to generate a query that can be used for a pareto chart (Bar Chart shows the count of a defect and a line chart as a second axis counts the cumulative percentage)

I've grouped my data, and sorted the Count of each time the record appears but I cant get my head around working the cumulative percentage. My datasheet currently looks like this:

Reason Count Per Expr1
A 35 47.9 Random Numbers
B 11 15.1 "
C 10 137 "
D 9 12.3 "
E 7 9.6 "
F 1 1.4 "

Expr1: DSum("Per","Rwk_Pareto","[Per]<=" & [Per] & "")

View 6 Replies View Related

Queries :: DSUM - Calculating Monthly Tasks Given To Employee

Dec 6, 2013

I have a query, i need to get dsum of total task given to an employee.

I have grouped task_description and select count and it is now showing each employee as 1 which is correct.. i ma looking to get dsum based on this task count but with a criteria that i want to see these tasks sum month a have a month field which i get from assigned date the month field is showing like this december-2013.

Based on this i want to calculate dsum as first to see task count which i mentioned earlier, then employee id which is in query as ID and then month.. this sum will calculate monthly tasks given to each employee.

View 5 Replies View Related

Queries :: Format Date Parameter In Dsum - Undefined Function

Sep 25, 2014

I m using Access 2010.I m Facing a problem in the undermentioned expression,

OPB: 1*Nz(DSum("[Trans]","LogDetail","[LocationID]='" & [LocationID] & "' AND [ProductID]='" & [ProductID] & "' AND [LogDate]<#" & Format([FromDt],"dd-mm-yy") & "#"),0)

when i run the query it gives "Undefined Function 'Format' in Expression" ?

View 3 Replies View Related

Financial Tracker

Nov 1, 2005

I would like to keep track of 5 seperate funds (or stocks) by price, daily change, total change...etc.

I was thinking of having a table with date as the primary key containing the daily price of each fund. I will enter the prices into this table manually every day.

A second table will automatically makes appropriate calculations and save these changes on a daily basis based on the date. With no user input.

Is this possible?

Can I have the second table automatically grab the dates from the first table? Would the second table use date as primary key for calculations?

Thanks,
~dnnymak :eek:

View 4 Replies View Related

Financial Functions

Sep 23, 2005

I am doing some work on a loan calculator which I have done successfully in Excel. I now wish to do this with an Access form (A2K). Can anyone please confirm that the Financial Functions (ie CUMPRINC etc) that are available in Excel can be used in Access. The Access help menu calls them Worksheet Functions and I can't see any reference to the above function in this forum. I have entered it in a control and get a #name? error. I dont know if I have made a syntax error or that Access doesn't recognise it.The following is the formula I have used =CUMPrinc([rate]/[freq],[nper],[amount],1,[nper],0).

I have not had the same problems with the following formula =PPmt([rate]/[freq],1,[nper],[amount],0)

Cheers

View 2 Replies View Related

SQL For Financial Summary From Transactions

Oct 20, 2005

I am working on a financial integration system that receives lists of financial journal transactions from several accounting packages.

I import and sumarise the transactions and end up with a transactions table like the one below. I now want to produce an Accounts summary (by period) table. I am trying to figure out how to do this just using SQL.

I do not want to use record by record VB because it is slow and I have a million+ records.

Can anybody help ?

Transactions Table (input)

Account Period Amount
1011100
1015 100


Account Summary (desired output)

Account Period Opening Movement Closing
101 10100100
10121000100
10131000100
10141000100
1015100100200

PS I need to run on Access and SQL Server

View 1 Replies View Related

Month / Year Queries

Apr 5, 2006

I always have a problem getting this to work without a lot of effort and I know it should be easier than I make it out to be. Problem is say I have a bunch of records I need to summarize by month. Say Dec 05, Jan 06, Feb 06, etc. When I bring down the date col, I do something like:

Format([date],"mmm - yy")

And do a totals query with a second col that returns say a count for each period. This works fine except that when I sort I get Dec 05, Feb 06, Jan 06, etc.

How can I do this with out having to create a third col to do the sorting stuff? Should I somehow wait until the data gets to the report to do the date format stuff???

:confused: :confused:

View 1 Replies View Related

HELP: Changing Dates To FY (fiscal Year) And YTD (year-to-date) Values

Apr 25, 2006

I have a huge table with transaction dates. I need to slice and dice
this data (sum, %'s, etc), but group by FY. Our fiscal year is from
7/1 thru 6/1.

For example:
1/8/2004 = FY 2004,
8/12/2004 = FY 2005,
2/3/2006 = FY 2006

THEN . . . . I need to also isolate certain periods, for example July-
March for YTD (year-to-date) analysis and compare YTD of 2006 with that
of 2005.

What do you suggest? Many thanks.

Mehran

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved