Queries :: Dates Showing Up For Multiple Months?

Jun 18, 2015

I have a query that is supposed to be showing todays data (as it is labeled) but it keeps pulling today's number date (i.e. the 1st, or the 17th) for every month, when i only want June 18th not including jan/feb/march etc. 18th.

I started running this query in may, that's why it only shows may and june's data.

I'm thinking it's definitely a problem with the criteria but check out the attachments and let me know

View Replies


ADVERTISEMENT

Queries :: Crosstab Query Using Dates For Next 12 Months

Jun 23, 2014

I want to create a cosstab query with dates for the next 12 months accross the top as columns and employee names down the side as rows. I then want to populate with data showing what each person is programed to do under the dates. For instance trainer 1 is delivering training from the 23/06-30/06 then designing a course from 02/07-10/07. that type of thing.

I could represent an activity using a colour i.e. yellow for delivery, green for design etc.

Also do I need to create a table with all the dates? Is there a quick way of doing this?

View 7 Replies View Related

Queries :: Dates In A Query - Show Orders By Month For Last 12 Months

Apr 22, 2013

I want to create a simple query from a list of orders dating back over 12 months.

The fields I have is Ord_Date, Qty

I need to show the orders by month for the last 12 months.

The problem I am getting is that the orders for the month of April (as we are in April now) contain orders from 1st - 22nd April 2013 and orders from 23rd - 30th April 2012, therefore confusing the figures.

I would just like orders grouped by month with a total qty dating back 12 months, but without any old orders for the current month.

View 6 Replies View Related

Queries :: Showing Available Vehicles By Dates

Mar 26, 2013

We have vehicles which are lent out to employees on a daily basis,

I currently have a query shown as a report which vehicles are out between the given dates using this criteria in a query

>=[ENTER Start Date] And <=[Enter End Date]

what I want to be able to do is show which vehicles are NOT being used between these dates tried a few different ways but no success

View 5 Replies View Related

Queries :: Date Criteria - Query Previous 12 Months Including Months With No Data

Mar 22, 2013

I currently have a form where users can enter an "End Date", click a button, and it queries the data from 12 months prior to "End Date" entered.

Is there a way to force the query to show all 12 months, even if there are no records for a particular month? For example: if the user enters February 2013 in the date field, I would like the query to return:

March 2012
April 2012
May 2012
June 2012
July 2012
August 2012
September 2012
October 2012
November 2012
December 2012
January 2013
February 2013

...so even if June 2012 has no records, it is included in the query with a value of zero.

This is what I have so far:

WHERE (((Qry_Tbl_Assets.Dte) Between DateAdd("m",-12,[Forms]![Main_screen]![End_Date]) And [Forms]![Main_screen]![End_Date]))

View 2 Replies View Related

Dates Into Months

Oct 18, 2007

The table I want to run the query on has a date in the format of dd/mm/yyyy. I want to be able to run a query so that the user can type in a month and all records with dates in that month will be shown.

I have done this before many years ago but now have a mental block and cant figure it out.

Any help with this would be greatly appreciated

View 3 Replies View Related

Dates Back 6 Months

Jun 7, 2005

Good morning all,
I currently have the following expression in a query, to go back 6 months from the current date.

Between DateAdd("m",-6,Date()) And Date()

Does anyone know of a way from the current date, go back to the end of the previous month ( 30th, or 31st) then go back 6 months?

hope that made sense.
Thanks
Kevin

View 2 Replies View Related

Subtracting Dates, Getting Whole Months

Dec 12, 2005

I found the following code on this site in a search for a method to subtract two dates ie [Startdate] and [EndDate] and display the result as a whole number. ie 2, 6 etc. This code finds the difference but displays the results as 1 year 5 months 2 days, where I need the equivalent as 17.
Can this code be modified to produce the desired result and if so how would I go about it. Thanks for the help.

Option Compare Database
Option Explicit

Public Function getTimeElapsed(StartDate, Optional EndDate As Date) As String
On Error GoTo Err_Handler

If IsNull(StartDate) Then
getTimeElapsed = "No startdate"
Exit Function
End If

Dim YY As Integer
Dim MM As Integer
Dim DD As Long

' use current day if EndDate is not supplied,
' + 1 makes both days inclusive.
EndDate = IIf(EndDate = 0, Date, EndDate) + 1

MM = DateDiff("m", StartDate, EndDate)
DD = DateDiff("d", DateAdd("m", MM, StartDate), EndDate)

' recalculate if DD is negative.
If DD < 0 Then
MM = MM - 1
DD = DateDiff("d", DateAdd("m", MM, StartDate), EndDate)
End If

YY = MM 12 ' integer division.
MM = MM Mod 12 ' remainder.

getTimeElapsed = YY & IIf(YY < 2, " year ", " years ") & _
MM & IIf(MM < 2, " month ", " months ") & _
DD & IIf(DD < 2, " day", " days")
Exit Function

Err_Handler:
MsgBox Err.Description
Exit Function

End Function

View 1 Replies View Related

List Dates 3 Months Ago

Mar 19, 2007

Hey

I need to find Customers who have not had a meeting for over three months and i need to list them in a query, please could someone help me as this is getting very frustrating

View 14 Replies View Related

IIf Statement Convert Dates To Months

Apr 28, 2006

I want to convert my dates to months so I added the statement below in the Field section of my query. It is not working. What am doing wrong?


Month:IIf([dateActivity]>=7/1/2004,IIf([dateActivity]>=8/1/2004,IIf([dateActivity]>=9/1/2004,IIf([dateActivity]>=10/1/2004,IIf([dateActivity]>=11/1/2004,IIf([dateActivity]>=12/1/2004,IIf([dateActivity]>=1/1/2005,IIf([dateActivity]>=2/1/2005,IIf([dateActivity]>=3/1/2005,IIf([dateActivity]>=4/1/2005,IIf([dateActivity]>=5/1/2005,IIf([dateActivity]<=6/30/2005,”June”,”May”),”April”),”March”),”February”),” January”),”December”),”November”),”October”),”Sept ember”),”August”),”July”))



Thank you.

View 5 Replies View Related

Difference Between Two Dates Into Years Months Days

Aug 31, 2006

Hello to everybody.

I have a problem in calculating the difference between two dates and displaying the output into Years Months Weeks Days. My problem is that dividing the number of days by 30 and requesting an integer is not accurate enough. I have looked at Pat and Jons examples shown in these threads

http://www.access-programmers.co.uk/forums/showthread.php?t=67472

http://www.access-programmers.co.uk/forums/showthread.php?t=89051&highlight=calculating+number+months

which either method would suit me as the accurate answer is what I am after.

My problem is that not all of my records would have a start and end date. Therefore both examples would result in an error.

Can anyone please give a hint on how to perform the calculations on those fields which have dates recording the results but ignoring those fileds which do not have a start / end date.

I am having a bad day and I'm sure the answer is so easy that I am going to kick myself but having played around with the modules by limited knowledge is not enough.

Many thanks in advance

Ian

View 3 Replies View Related

Modules & VBA :: Calculating X Years / X Months And X Days Between Two Dates

Jul 19, 2013

Find the difference between two dates is simple if you're simply looking for the number of days between them. However, if you're looking to express the difference in a bit more user-friendly way, you can use the following code to calculate the difference in years, months, and days. The code accounts for zero values, plurals and the Oxford comma. Further, it automatically sets the later of the two dates to the End date, so the dates can be used interchangeably.

Examples:
June 4, 2010, July 3, 2012 returns "2 Years and 29 Days"
June 4, 2010, July 5, 2011 returns "1 Year, 1 Month and 1 Day"
June 4, 2010, June 5, 2010 returns "1 Day"

Code:
Function DiffOfTwoDates(dtmDate1 As Date, dtmDate2 As Date) As String
' Written by Will Knapp, Freelance Access Developer, 2013
Dim dtmStart As Date, dtmEnd As Date
Dim strDiff As String ' Resulting String
Dim yDiff As Integer ' Year Difference
Dim mDiff As Integer ' Month Difference
Dim dDiff As Integer ' Day Difference
Dim CommaLoc As Integer

[code]....

View 3 Replies View Related

Queries :: Multiple Dates Fields

Nov 15, 2014

I have a DB that consists of Movie titles and the multiple dates ( as many as 10) on which they will be used in the coming year.I built a flat table with 10 date fields.Then tried to build a relational table with just movie title and dates linked to ID.I cannot work out an ability to SEARCH the Database for a SPECIFIC DATE and get returned a listing of ALL Movie titles that will air on that date,

View 9 Replies View Related

Enter Parameter Dates Once For Multiple Queries?

Jan 16, 2008

I have created a db with 10 linked tables from 10 db's.
I then build 10 queries associated to these linked tables.
The 10 queries filter data by start date and end date.
The data generated from each query is then exported to excel (each query has its own sheet in the woorkbook).

Dim Output_Path_And_File As String

Output_Path_And_File = "C:" & "Production Labor hrs Querie.xls"


DoCmd.TransferSpreadsheet acExport, 8, "labor hrs 3-WAY", Output_Path_And_File, False, ""
DoCmd.TransferSpreadsheet acExport, 8, "labor hrs-ACV", Output_Path_And_File, False, ""
DoCmd.TransferSpreadsheet acExport, 8, "labor hrs-EAP", Output_Path_And_File, False, ""
DoCmd.TransferSpreadsheet acExport, 8, "labor hrs-EVMV", Output_Path_And_File, False, ""
DoCmd.TransferSpreadsheet acExport, 8, "labor hrs-PFE", Output_Path_And_File, False, ""
DoCmd.TransferSpreadsheet acExport, 8, "labor hrs-propor", Output_Path_And_File, False, ""
DoCmd.TransferSpreadsheet acExport, 8, "labor hrs-SEGR", Output_Path_And_File, False, ""
DoCmd.TransferSpreadsheet acExport, 8, "labor hrs-TBO", Output_Path_And_File, False, ""
DoCmd.TransferSpreadsheet acExport, 8, "labor hrs-VCA", Output_Path_And_File, False, ""
DoCmd.TransferSpreadsheet acExport, 8, "labor hrs-VFS", Output_Path_And_File, False, ""


How can I set these queries up by typing the start date and end date only once rather than 10 times?

Thank you

View 5 Replies View Related

Queries :: Multiple Counts Between 2 Dates In 1 Query

Mar 4, 2015

I have a list of dates and I want 1 query which counts the dates between numerous criteria. for example, colum 1; dates between 1/1/14 and 16/02/2014. Colum2 between 17/02/2014 and 15/04/2014.

I have attached a screenshot.

View 4 Replies View Related

Queries :: Counting Multiple Dates In A Single Query Field

Feb 8, 2015

I'm creating a database for my wife to use in her work, one of the fields is dates visited and the user should enter "00/00/0000, 11/11/1111, 22/22/2222, 33/33/3333" in this format. The field is a large text format because there could be anything from 1 date to hundreds. What I need to be able to do is in my query I need to enter 2 dates and have access return a how many dates exist between those 2 date values. eg It will pop up a box asking for start date and then another asking for end date and then it has to return the count total of how many dates exist between those two date values. I don't know VB and have had only basic training in Java and C# none of which involved Access. The only way I can think of doing it is to have access count the number of commas within the date field required but I don't know the formula required assuming it can even be done.

View 1 Replies View Related

Queries :: Find Latest Date In A Table Where Dates Are In 2 Separate Columns And Multiple Rows

May 19, 2015

I am trying to find the latest date in a table where the dates are in 2 separate columns and multiple rows. (there are business reasons why there are 2 dates per row they represent different but comparable activities)

I have a table "Assessment tracker" with the following structure

Name Type
Candidate short text
Unit short text
EV1 Date Date
EV2 Date Date

My Data:

Candidate Unit EV1Date EV2 Date
TH1 10 07/05/2015 25/05/15
TH1 10 07/05/2015 07/06/15

I have a query "Candidate AC Dates" that compares the 2 dates EV1 and EV2 and outputs a 3rd column with the latest date.

Query:
PARAMETERS [Candidate Name] Value;
SELECT [Assessment Tracker].Candidate, [Assessment Tracker].Unit, [Assessment Tracker].[EV1 Date], [Assessment Tracker].[EV2 Date], Max(MaxDate([Assessment Tracker]![EV1 Date],[Assessment Tracker]![EV2 Date])) AS Achdate
FROM UnitData INNER JOIN [Assessment Tracker] ON UnitData.Unit = [Assessment Tracker].Unit

[Code]....

Output:

CandidateUnitEV1 DateEV2 DateAchdate
TH11007/05/2015 25/05/201525/05/2015
TH11007/05/2015 07/06/201507/06/2015

It does this by using a function shamelessly copied from the web somewhere...

Function Maxdate(ParamArray FieldArray() As Variant)
' Declare the two local variables.
Dim I As Integer
Dim currentVal As Date' Set the variable currentVal equal to the array of values.
currentVal = FieldArray(0)
' Cycle through each value from the row to find the largest.

[Code]....

This is working well (I think)

I then want to find the latest date for the 2 records i.e. the Max value for the Achdate.

Query:
SELECT [Candidate AC Dates].Candidate AS Expr1, [Candidate AC Dates].Unit AS Expr2, Max([Candidate AC Dates].Achdate) AS MaxOfAchdate
FROM [Candidate AC Dates]
GROUP BY [Candidate AC Dates].Candidate, [Candidate AC Dates].Unit
ORDER BY [Candidate AC Dates].Candidate, [Candidate AC Dates].Unit, Max([Candidate AC Dates].Achdate) DESC;

But this is returning

Candidate Unit MaxOfAchdate
TH1 1025/05/2015

I expect it to return

Candidate UnitMaxOfAchdate
TH1 10 07/06/2015

It looks to me like MAX is considering only the day value rather than the whole date. I suspect this is because it is considering the results of the function in the first query as a short text rather than a date field. (I've tried to force this through declaring the variables as dates but don't know where else to force this. (I am UK based hence the DD/MM/YYYY format)

View 14 Replies View Related

Query Showing All The Dates Within A Range

Nov 19, 2007

Is it possib;e to create a query that would all the dates withn a range of Date1 and Date ?
Ex if I have

Filed Date1 Date2
x 1/1/07 1/3/07
c 1/6/7 1/8/7

for query to show

Field Date
x 1/1/7
x 1/2/7
x 1/3/7
c 1/6/7
c 1/7/7
c 1/8/7

View 1 Replies View Related

Create Reports Showing All Start Dates By Month

Dec 8, 2014

I have a table that has the following:

ID
Program Year
Program
Start Date
Midpoint Date
Internship Date
End Date

I have successfully created queries to create reports showing all Start Dates by Month no matter what program and similar reports for all the other date queries. What I need it to do is list everything happening within a month and sort them by category. How do I do that? I've attached the database so you can see my queries as well as the main switchboard reports associated.

View 4 Replies View Related

Queries :: Fill No Sales Months With 0

Aug 9, 2013

I am pulling sales results per customer and month. For presenting the numbers in a diagram I would like to show 0 sales for months in which no sales were generated. At the moment the query results only the months in which there are sales > 0. Is there a trick that I don't know?

SELECT Year([InvoiceDate]) & ' ' & Month([InvoiceDate]) AS [Month], totalsales_per_invoice([invoices]![InvoiceID],[invoices]![tax]) AS Ausdr1
FROM Invoices INNER JOIN customers ON Invoices.CustomerID = customers.CustomerID
WHERE (((Invoices.InvoiceDate) Between #1/1/2013# And #7/1/2013#) AND ((customers.CustomerID)=145))
GROUP BY totalsales_per_invoice([invoices]![InvoiceID],[invoices]![tax]), Year([InvoiceDate]), Month([InvoiceDate])
ORDER BY Year([InvoiceDate]) DESC , Month([InvoiceDate]) DESC;

View 3 Replies View Related

Queries :: Comparing Two Tables Across Months

Sep 16, 2013

As a Access newbie I am looking into a problem that I hope to solve structurally and "transparently" via Access in stead of Excel.

I would like to compare two similar tables for different months. I am looking for:

+ loan id's that are new in table(t), i.e. not exist in table(t-1)
+ loan id's that exited: that is exist in table(t-1) and not in table(t)
+ loan id's that stayed in both

How do I solve this in the easiest way?

View 4 Replies View Related

Queries :: All Records With 12 Months Of Date?

Aug 6, 2014

We have a field (tbl_Enrolment.CourseCompletedOn) which holds the date a colleague completed a course. I want to bring through all courses completed within 12 months of todays date ( Date() ) from our database. I checked google and it suggested YEAR but that would only bring through dates with the same year, not within a 12 month period.

View 4 Replies View Related

Queries :: Pick Up Data For Last Two Months

Mar 3, 2015

I have a query that pulls data for the current month and the last two months. It had been working fine until 2015. The problem is that it's looking for the last two months but for 2015. How do I edit my formula to pick up the two months and for it to know it's a different year??

Code:
CMSPM2: IIf([LOB]="CMS" And Month([Month])=Month([Forms]![Main Menu]![EndDate])-2,Count([Question]),0)

View 2 Replies View Related

Queries :: Calculate Expiry Dates Of Training Courses - Due Dates Not Shown

Aug 28, 2013

I have built a query to calculate the expiry dates of training courses but I am trying to input a criteria so that only dates within 90 days of todays date show. I am using Date()<90 but it doesn't return the correct information. What the criteria should be for this?

View 1 Replies View Related

Multiple Min / Max Dates By Sequential Dates

Apr 4, 2012

I have a scenario where the first three rows of date which have dates of 4/1, 4/4/ 4/6 with ndc 5513026701; next six rows that have dates from 4/8 to 4/20 with ndc 5513014801; next three rows that have dates from 4/25, 4/27, 4/29 with ndc 5513026701.

The issue I am having is I do not know how to have separate min/max dates for ndc 5513026701 since when I group by ndc 5513026701 min = 4/1 ; max = 4/29. I need to have min = 4/1 and max = 4/6 for one row and another row of min = 4/25 and max = 4/29.

Any easy way to sequentially create min/max for each ndc 5513026701? I wasn't sure how to verbalize this so I have attached a sample worksheet.....

View 2 Replies View Related

Queries :: Calculating Years / Months And Days

Aug 6, 2014

I'm trying to breakdown a date into years, months, and days. Simple right?

The code I've been using for months returns a negative month if it happens to be the next month. Instead of returning 1 Year, 1 Month, 23 Days, it will instead return 1 Year, -1 Month, 23 Days.

Code is:

Code:
Months: IIf(IsNull([TIR]),0,IIf(Day([TIR])<=Day(Date()),DateDiff("m",[TIR],Date())-[Years]*12,DateDiff("m",[TIR],Date())-[Years]*12-1))

View 4 Replies View Related







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