Modules & VBA :: Find Price For Given Month?

Aug 20, 2014

I have a table of upcoming price increases by item / valid from date

Item Price ValidFrom
1234 10 01/01/2014
1234 20 01/06/2014
3456 15 01/01/2014
3456 25 01/06/2014
3456 35 01/01/2015

I also have a table of upcoming sales

Item Month Qty Price
1234 Feb 14 20 ????
1234 July 14 30 ????
3456 Sept 14 25 ????

How do I calculate the correct price in a query

View Replies


ADVERTISEMENT

Modules & VBA :: Find Last Day Of Month From A Date Field

Dec 10, 2013

I'd like to further automate our invoicing system and need a field which has the last day of the month an item was completed.

Currently we have a field in the table called [Date Done]. I'm planning on adding a further field [Tax_Point].

I'd like the field to select the [date done] value and enter the final day of that month, unless, the final date of that month is in the future. in which case it would need the current date.

We create invoices at sporadic times of the month, and in the next month for the previous month; hence the need for a system date check.

View 5 Replies View Related

Last Price Of Month Query?

Apr 1, 2015

We have this database:

It has Symbol on the first column, Date (daily on trading days) on the second and Close on the third.

We want a query that shows the last CLOSE of the month for each symbol and sum the volume of the month.

The query table would be like this:

Symbol
Date (last date of the month)
Close (last date of the month)
Volume (sum of whole month)

Here's the sample file:

Sample.accdb

View 9 Replies View Related

Queries :: Item Without Price Or Duplicate Price

Jul 29, 2013

I have a table called Books, in that table there is 4 columns ChapterName, Auther, ITEM, Price.

Each book has a item number, and each book has a few records with the same data, just the first column is different where its the ChapterName, each book has a price, but only once, meaning in the first record of each book it will be a price in the column price

Now I want a Query where i can get which book dont have a price at all, and which book has more than once a price, how can i do that?

View 1 Replies View Related

Find Info For Specific Month

Aug 26, 2007

I have many queries for separate types of income that when criteria is entered on the switchboard, a report is created for either a specific month or range of dates. This works fine. Now I need to create one report that shows all 7 types of income in one spot, but once again based on a specific month or range of dates. I have a query that produces the entire income for all dates, but can't get it narrowed down to the specific criteria.

View 8 Replies View Related

Queries :: Months To Be Find From Numeric Month Field

Nov 15, 2013

i have to process 3 upcoming months bills .. say i want to show in query like this bill for Nov, Dec, Jan based on the issue date i mentioned earlier and the months to be find from the numeric month field like 3 i mentioned which mean 3 months ahead from issue date.

View 8 Replies View Related

Modules & VBA :: Subtotal Based On Month Not Day?

Oct 4, 2013

I have created some subtotals in some columns of data which for example are the dates, names, and amounts of invoices.

The code I used is:

Range(Range("C1"), Range("C1").End(xlDown)).Select
Selection.CurrentRegion.Subtotal GroupBy:=1, Function:=xlSum, TotalList:=Array(3)

This is working of sorts but it is giving me subtotals based on the day in the date column. How can I change this to group by the month?

View 10 Replies View Related

Modules & VBA :: Determining New Month And Run A Procedure

Aug 6, 2013

I've been stumped for the past couple of days trying to discern a method for a form to determine that it's a new month and run a procedure and only run it on month change.

My initial thought is:

Open recordset
move to the last record
compare the month in a date field within the last record to the current month
and run the procedure if the month is different.

I can't get this to work however and I'm not sure what I'm doing wrong. To be honest I typically fumble my way through VBA when it comes to opening recordsets. Here's what I got:

Code:
Dim rs As DAO.Recordset
Dim db as CurrentDB
Dim strSQL As String
Set rs = CurrentDB.OpenRecordset("FlightLog")
strSQL = SELECT [txtDate] FROM [FlightLog]

[Code] ....

txtReqNumb and txtFltNumb are the values to be reset at the beginning of each month.

Am I on the right track and just have the VBA wrong?

View 4 Replies View Related

Modules & VBA :: Change Date By Month?

Dec 4, 2014

I use textboxes to limit the time periods for report the defaults are set to first and last day of previous month I'd like to add a button that would set you a month back/forward, but I'm stuck on how to change values to correspond to first/last day ofprevious month

this is my onload code

Quote:

LastDay = DateSerial(Year(Date), Month(Date), 0)
FirstDay = LastDay - Day(LastDay) + 1
Me.tdat1 = FirstDay
Me.tdat2 = LastDay

View 3 Replies View Related

Modules & VBA :: Convert Weeks To First Day Of Month

Feb 28, 2014

I am trying to convert a week which is entered in a text box on a form to the first day of the month in which it falls.

My text box (txtdw) is in the format yyww and I want it to be converted to 01/mm/yyyy.

example: 1401 would convert to 01/01/2014. 1406 would convert to 01/02/2014.

I am pretty close, I can get to the correct month but I can't work out how to change to the first day of the month.

Code:
DateAdd("D", Right(Me.txtDW, 2) * 7, DateSerial("20" & Left(Me.txtDW, 2), 1, 1))

View 4 Replies View Related

Modules & VBA :: Deleting Records Based On Month

Jul 26, 2013

I want to write an sql or vba code to delete records based on the month...For example I have a field called date which contains a date and I want to delete all Dates that are In April

Ive tried
Delete from LinkTable Where month(Date) = 'April'
Still Nothing

View 3 Replies View Related

Modules & VBA :: Determine Year From Month Count?

Jun 16, 2014

I have a table that has a field for month represented by a number. I would like to report by month but group by year. The report would group months 1-12 into year 1, months 13-24 into year 2, months 25-36 into year3, etc..... up to possible 20 years. Is there an easy way to identify and group the year? I was thinking of adding another column to the table and when I write the values to it include a year. I would rather do it some other way as the data is spilt and would require a lot of table modifications to distributed db. It would be easier to do it with a query or some code in the front end.

View 2 Replies View Related

Modules & VBA :: Calculating Week Of A Month For Given Date

Mar 3, 2014

I have found multiple ways of calculating the week of a month for a given date. Now, I want to reverse it, i.e. given a month and week and day of week calculate the date.

Note that in week 1 and last week, there will often be days with no value.

View 2 Replies View Related

Modules & VBA :: Convert A Month To Number In A Column

Oct 13, 2014

I have a table that has just Months in a column. As in January, February......

I want to convert these to Numbers as in 1-12 in VBA. I tried all the DatePart in every combination but can't seem to get the results.

View 5 Replies View Related

Modules & VBA :: Month And Week Criteria In A Module

Sep 23, 2013

I am trying to return a value in an expression (call it FundedPeriod): CurrentWeek, CurrentMonth, PreviousMonth, based on a date value in field [funded_date].

Here are the criteria I am using:

Current Week: DatePart("ww", [Funded_Date]) = DatePart("ww", Date()) and Year([Funded_Date]) = Year(Date())

Current Month: Year([Funded_Date]) = Year(Now()) And Month([Funded_Date]) = Month(Now())

Previous Month: Year([Funded_Date])* 12 + DatePart("m", [Funded_Date]) = Year(Date())* 12 + DatePart("m", Date()) - 1

Based on example, I expanded upon that and came up with this:

Code:
Function FundedPeriod(FD)
' returns CurrentWeek or CurrentMonth or PreviousMonth or None based on FundedDate (FD) criteria
Dim ret As Boolean
ret=CurrentWeek

[Code] ....

Am I in the ballpark w/ this in order to return:

CurrentWeek or CurrentMonth or PreviousMonth

so in the query expression I think I would type FundedPeriodName: FundedPeriod([funded_date])

View 5 Replies View Related

Modules & VBA :: Loop To Do Rolling 12 Month Average

Aug 13, 2013

May be VBA is a better solution for this:

Say for Material A: I need Access to see that the 1st date is 05/01/2013 and say 365 days out or 12 months (05/01/2013-04/01/2014) the average is 158.6 then 06/2013-05/2014 the average is 146.667 and so on.

Every month is not going to be listed in the results, if there is no month then assume 0.

Sample data attached.

View 7 Replies View Related

Modules & VBA :: Getting A String With Month / Year From A Date

Apr 7, 2015

I need to use VBA to get a string which is essentially just a month and year (so date, not including day)

Would Prefer it to be 04/15 as opposed to April-15, as the number is easier to sort than the word (how to sort month names in numerical order as opposed to alphabetical id).

So that I assume i could do by =format(now(), mm/yy) (though havent actually tested it)

However to add to the complexity id also need to add a month to it, so for instance todays date is 08/04/15, id need the string to read "05/15"

or if the date was 10/12/15 id need the string to read "01/16"

View 3 Replies View Related

Modules & VBA :: Open Report - Filter Month And Year

Feb 25, 2015

I have vba code

PHP Code:

    DoCmd.OpenReport "MonthlyData2", acPreview, , " YEAR(CourseDate) = '" & Me.txtCourseDateMonth & "' " 

this works sucessfuly how can I add the following to the code so it filters month and year?

PHP Code:

'" MONTH(CourseDate) = '" & Me.txtCourseDateYear & "' " 

View 5 Replies View Related

Modules & VBA :: Monthly Reports Starting By Custom Month

Sep 9, 2013

I'm creating an accounts package..I've used access chart wizard to create a chart that shows total gross income per month.This displays correctly but the months start at January and end in December. It would be more useful if the months could start and end for the financial year. The syntax generated by access for the current implementation is:

Code:
SELECT (Format([DatePaid],"MMM 'YY")),Sum([TotalPaid]) AS [SumOfTotalPaid] FROM [Q_AllCust_Gross] GROUP BY (Year([DatePaid])*12 + Month([DatePaid])-1),(Format([DatePaid],"MMM 'YY"));

How do I edit this to make say September my start date?

View 2 Replies View Related

Modules & VBA :: Number Of Weekend Days Worked In A Month?

Oct 6, 2013

My subreport provides appointment stats for every month and is grouped by month in the main report. I manage to include the number of days for each month using:

=DateSerial([YearNo],[MonthNo]+1,1)-DateSerial([YearNo],[MonthNo],1)

in a text box, and it works fine.

But I don't know the syntax to get these numbers:

the number of weekend days worked in that month, and the number of weekend day not worked in that month My field is call App_date.

Tried this but does not work - the numbers it returns are incorrect (in every month): =Count(Weekday([App_Date]))

The subreport's is based on a select query with only the Appointment table. It only has four "fields" - that work fine.

They are: the appointment date and its date parts - defined in numbers.

App_date
MonthNo: DatePart("m",[App_Date])
YearNo: DatePart("yyyy",[App_Date])
DayValue: Weekday([App_Date],2)

how to get my weekend work and not work total day count?

View 13 Replies View Related

Modules & VBA :: Calculate Next Service Month Based On Dates

Jan 16, 2015

I've been trying to solve this problem for the past month and at the verge of destroying my PC! I've trawled through numerous web sites but just cant seem to figure this one out.I'm trying to get access to tell me what the next service moth is based on the start date, end date, and the frequency of service.

For example:

Start date: 01/01/2014
End date: 31/12/2015

service frequency: Every 4 months

Using the above information the service months are:
1 - April 2014
2 - August 2014
3 - December 2014
4 - April 2015
5 - August 2015
6 - December 2015

View 6 Replies View Related

Modules & VBA :: Count Total Working Days Of Month

Mar 5, 2014

I have a table with two fields named as "Month" and "Bank Holidays". I have put names of the month in this table for 2014 and the corresponding bank holidays of each month. Now I want to write down the piece of code that will execute when a button is pressed and check the current month of the year and then display the total working days ( After subtracting bank holidays of that month and weekends of that month from the total working days of that month).

View 2 Replies View Related

Queries :: Rolling 12 Month Query - Keeping Track Of Orders Placed For Given Part Number By Month

May 5, 2014

I am trying to create a database that will keep track of the orders placed for a given part number by month. Currently, my table houses the part number, and the ordered amount for the past three years by month (there are thirty-five columns for every part). My column headings are ORDER_MAY_2013, etc. I would like to set a query up that will look at the column headings and pull the amounts ordered for each part for the past twelve months. In other words, I have three years of data in my table. In my query, I just want one year. However, I don't want to have to rewrite the query every month so that it will pick up the new data. Is there a way to accomplish this?

Is there a better way to build this database? I thought about just have four columns in my table - PART_NUMBER, ORDER_MONTH, ORDER_YEAR, ORDER_AMOUNT. The only problem there, is that every part (there are about 450 parts) would have to be listed 35+ times. That seemed too redundant to me, so I built the table this way. However, now I am having trouble querying against it.

View 2 Replies View Related

Modules & VBA :: Button To Export All Records In Database In Specific Month

Nov 6, 2014

I am trying to create a button on an access form that will prompt the user to enter a search month and then export to excel all records in that database that match that month.

So, if the user prompt "what month" is October, then THE 30 records in the field [receivedate] that are in october (10/XX/XXXX) are exported to excel.

View 7 Replies View Related

Modules & VBA :: Export Records By Date Based On Input Month

Nov 10, 2014

I am trying to export records to excel that are in a given month based on an input month. The user would select the month with the records desired and click the button to export them to excel. The attached zip file has an image of the database and the code behind the button is:

Code:
Private Sub Command33_Click()
DoCmd.OpenReport "HLA_TAT", , , "Len(Exception & '') > 0 AND Receive_Date > #" & Forms!HLA_TAT.Date & "#"
End Sub

[CODE] can not access referenced form HLA_TAT [?CODE]

View 11 Replies View Related

Calculate Variance Of Payment Month On Month - Values Comparison

Mar 19, 2012

I have a MS access table with 12 numerical columns for 12 Months payments for our customer base.

I need to calculate variance of payments month on month and identify set of customers who have made huge payments.

View 10 Replies View Related







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