Queries :: How To Show Records Based On Date

Nov 8, 2013

I have a form where someone enters a 'Job' to be done which in turn creates a record in a table with all this information

On the form I have a field called 'Repeat Frequency' where the user can choose how often they would like this 'Job' to repeat. e.g. Monthly

Then, on another form someone else can check what 'Jobs' should be done on that day

I have managed to get this to work fine using the DatePart function and it displays all jobs to be done that fall on the current day (e.g. if they choose to repeat it weekly, it will look for all entries where the datePart "d" [DateToBeDone] = Date()-7, -14, -21 and -28)

The problem is that i have been limited to the options of 'repeatability'

What i would like to do is change the options from 'Weekly', 'monthly' etc and instead have a field makrked "Repeat every so many days"

Is there a criteria i can use in a query where i can show records every so many days? i.e. if there is a job in the system that should repeat every 7 days and the [DateToBeDone] is set to 31/10/13, it would return this record on 07/11/13, 14/11/13, 21/11/13 and so on?

I Have tried DatePart ("d", [DateToBeDone]=DatePart ("d", (Date()-[RepeatDays] but what happens is it only shows it if the day is that many number of days in the past and not multiples as i said above.

View Replies


ADVERTISEMENT

Queries :: Show Price Valid On Specific Date Based On Two Parameters

Mar 30, 2015

I atrying to make a query that shows the price for a product, based on two parameters.

Parameter one is a product code.
Parameter two is a date. This date falls between two dates.

I have one list (table) where is product code and invoice date.

The second list (table) I have, contains product code, and price valid from date, and price valid to date columns. This price valid to date is often not filled, and the price I still valid as we speak. If the date is filled there is often a new entry with an updated price. But sometimes, even if there is a new entry in the table, the date 'valid to date' is sometimes also not filled.

I would like Access to show me the valid price for the specific product. What criteria should I give in the macro, in order that Access shows what I want?

For illustration purposes, a small overview of my table:

Product code, Price, valid from, valid to
AAAA, 12000, 01.01.2012, 31.12.2012
BBBB, 16600, 01.01.2012, 12.06.2013
AAAA, 13500, 01.01.2013, 28.08.2013
AAAA, 11500, 29.08.2013,
BBBB, 17600, 13.06.2013,

Product, invoice date, price according to price list
AAAA, 02.05.2012, ????
AAAA, 01.08.2012, ????
BBBB, 10.06.2013, ????
AAAA, 31.10.2013, ????
AAAA, 16.11.2013, ????

If you happen to know how this search can be performed in Excel, I am of course also happy to read that. (But my index, or Vlookup functions, give only the first possible result in the table. As I do not know how to give in the date parameter.)

View 11 Replies View Related

Queries :: Sort Out Invoices By Year - Query Based On Combo Box To Show All Records

Mar 4, 2015

I am trying to have a query sort out my invoices by year but also to have the possibility to show all invoices.

I have one table "INVOICE" where I have a column "YEAR" calculated with DatePart function from the invoice date.

On my form "INVOICE LISTING", I want to have a combox "Combo957" selecting the year. I have forced the "ALL" selection to the combox using a UnionQuery.

My problem, I cannot get the query to work. I have tried many ways, the closest I can get is :

IIf([Forms]![Invoice Listing]![Combo957]="ALL",([Invoice].[Year])<Year(Date()),[Forms]![Invoice Listing]![Combo957])

If I select the year from the combo, it works, if I select "ALL" nothing is shown.

here is the full SQL

SELECT DISTINCTROW Companies.Company, Companies.City, Companies.Country, Sales.Brand, Sales.Type, Sales.Date, Sales.QuoteNo, Sales.Delivered, Sales.Account, Sales.Branch, Invoice.InvoiceNumber, Invoice.InvoiceDate, Invoice.CustOrderNumber, Invoice.PaymentTerms, Invoice.DueDate, Invoice.NetAmount, Invoice.TotalAmount, Invoice.Tax, Invoice.PaiementRCVD, Invoice.Overdue, Invoice.Month, Year([Invoice]![DueDate]) AS DueYear, [Invoice]![month] & " - " & [Invoice]![Year] AS InvoiceMonth

[Code] .....

View 5 Replies View Related

Queries :: Show Data - Query Based On User Selected Time And Date Range

May 17, 2013

I have a form that request information from the user (StartDate, StartTime, EndDate and EndTime) the problem is that it's not working. The only way I can get any data to show is when I remove the StartTime and EndTime. Only then will it pull the items from the StartDate and EndDate.

Here is what I have as my criteria: Between [Forms]![OpPROD_ALL]![StartTime] And [Forms]![ OpPROD_ALL]![EndTime] And Between [Forms]![ OpPROD_ALL]![StartDate] And [Forms]![ OpPROD_ALL]![EndDate]

The users will be able to request a report based on a start and end date along with a start time and end time.

Side note: this is to pull date for 3rd shift (Example) 4/14/2013 10:00PM - 4/15/2013 10PM

View 1 Replies View Related

Queries :: Filter Using Date Range But Show All Records If Text Box Null

Jan 13, 2014

I m trying to make form which filters my records and generates a report..here's where I am

Code:
Like "*" Or Between [Forms]![Form1]![Text6] And [Forms]![Form1]![Text8] & "*"

but this doesn't work I would like to show all records if textbox 6 is null and textbox8 is null this part of code works perfect but below but I'm struggling to get the between in with the code

Code:
Like "*" & [Forms]![Form1]![Text6] & "*"

the code is in report record source

View 9 Replies View Related

Queries :: Pulling Records Based On Date Of Another Record?

Sep 29, 2014

I have a file of transaction history from the accounting system. All of the payroll cash payments are coded as ZG. Payroll accruals are coded as ZC. I need a sum of payroll accruals by department that have the same date or later than the last payroll cash payment. How do I write that query?

View 1 Replies View Related

Queries :: Return Records Between Dates Based On 2 Date Fields In A Table

Apr 24, 2013

I have a table which includes a start date field and completion date field for housebuilding.

I am trying to extract all records that have either a started date or a completed date between 2 dates supplied by the user. I have tried to use Between on both fields but that doesn't return results between the fields.

It workd if I just do it on EITHER the start date field OR the completion date field so that implies to me that I need to break it into 2 queries, one returning start date recrods and the other returning completion date records but then I would need to have somthing that removes records that appear in both the start date and the completion date results.

View 7 Replies View Related

Queries :: Tracking Time Spent On Customers Records Based On Date Of Entry

Apr 17, 2014

I have two tables, One table containes customer name, etc., tblcustomers the other table contains the tbltimelog, log of activity start time end time. No issues. I want to generate a form based on the dateofentry for the time record. I am not able to get a summary lets say I spent 20 hours on ABC and 20 hours on CBS. If I spent 3 different days on ABC and 6 different days on CBS it will not add them together it will list it ABC 3 times and CBS 6 times. I have tried the distinct function but it doesn't work because the date is distinct. Is there a way to do this as an SQL or whatever. Thinking I could just create a new table and calculating the totals but that seems to be a waste.

View 3 Replies View Related

Show Records Based On Duplicates Between 2 Tables

Aug 20, 2007

Ok.. I have been racking my brain for hours trying to figure out how to do this. Maybe someone here can help me figure this out.

I have 2 tables. "AR94" & "RPIN"
I need a query to look at the "Provider_PIN" field of both tables in order to find duplicates between that field in both separate tables at which point I need it to say If a duplicate provider_pin exists in the AR94 table & the RPIN table Then remove that provider_pin from the "RPIN" table.

The final result should be that the only records showing in the "RPIN" table would be those provider_pins' that were NOT found in both tables.

Starting Example (Before query):
AR94 Table:
-----------
1234
12345
123456
1234567
12345678

RPIN Table:
-----------
1234
4567
45678
12345678
456789

Results that should be achieved (after running query):
RPIN Table:
4567
45678
456789

Thereby deleting the 1234 & 12345678 values from the RPIN table leaving only records that were NOT found in both tables.

Please help me as I am trying to get this done for a project and can't figure it out..:confused: Thanks.

View 7 Replies View Related

Forms :: Show Table Data Based On Date Field?

Jan 30, 2015

I have a form that each day needs to be filled in by staff of their activities.

By selecting a date, I want to the textbox to display the contents of the comments memo pad field in the table (tblToday...columns are t_date and t_comments).

My very limited access and previous SQL knowledge has eluded me and cannot fathom how to get the text box to show data based on the date selected?

View 9 Replies View Related

Need Report To Show A Number Of Records Based On A Value In A Field Of A Table

Aug 9, 2006

Hi,

I have a table with a field that shows the number of pieces that a parcel contains. It looks like this:
ParcelID, Pieces, Description

Data example:
1001, 5, Jackets
1002, 10, shoes
etc

I need to print labels for each piece that shows to which parcel it belongs. The report will look like:
1001, Total pieces = 5, 1 of 5 pieces, Jackets
1001, Total pieces = 5, 2 of 5 pieces, Jackets
1001, Total pieces = 5, 3 of 5 pieces, Jackets
1001, Total pieces = 5, 4 of 5 pieces, Jackets
1001, Total pieces = 5, 5 of 5 pieces, Jackets

and
1002, Total pieces = 10, 1 of 10 pieces, shoes
1002, Total pieces = 10, 2 of 10 pieces, shoes
1002, Total pieces = 10, 3 of 10 pieces, shoes
1002, Total pieces = 10, 4 of 10 pieces, shoes
1002, Total pieces = 10, 5 of 10 pieces, shoes

If I could populate a table where the number of records equal the value of the pieces column then it's a pretty simple report but I can't figure this out.

Can anyone help?

View 1 Replies View Related

Show Records In Query Based Off User Input In Form

Nov 3, 2005

Ok this might be basic stuff i'm a bit dumb

I have a query showing lots of records of equipment that is in different rooms. I would like to have a form where the user can bash in a room number and all the records from the query that have that room number in it pop up.

Please help the dumb

View 3 Replies View Related

Forms :: Cannot Reset Form And Show All Records Based On Expression

Nov 19, 2013

I have the below code to reset my subform after I have filtered it using some combo boxes. One of my fields in the underlying table had a calculated field so I'd get an error when clicking the reset button. I edited the query to update the 'type' field and deleted the calculated field in the table but now get another error. The exact error is 'Run-Time error '3327' Field 'Type' is based on an expression and cannot be edited.' It appears it will not reset my form and show all records as long as this field is based on an expression.

Code:
Private Sub cmdReset_Click()
'Purpose: Clear all the search boxes in the Form Header, and show all records again.
Dim ctl As Control
'Clear all the controls in the Form Header section.
For Each ctl In Me.Section(acHeader).Controls
Select Case ctl.ControlType

[Code] ....

View 6 Replies View Related

Forms :: Show Newly Appended Records In Form Based On Table

Jun 26, 2014

I have an append query that appends records to a table, and I have a form based on that table.

Users will click a button that will run the append query and then open a form for users to fill in remaining empty cells. How can I filter the form to show only the newly appended records?

View 3 Replies View Related

Show Records Only Where Date Is Within The Next Week?

May 26, 2006

Dear All, I have a field named: “reminder date” in a query and would like to show only records where the reminder date is within the next week whenever the query is run (ie if todays date is 26th may 2006 and I run the query now It would only show records that include the following dates 27,28,29,30,31, july and 1,2 June)

Ive tried the below bit of code but this shows to many records beyond one week.
>=DateAdd("d",+7,Date())

Anybody have any suggestions?

Regards

Jim

View 8 Replies View Related

Queries :: Query To Show Field Based On Last Record ID?

Sep 4, 2014

I am looking to get a query to show my list of customers "Grouped By" [CustomerName], that show only the single [CurrentBalance] field for each customer based on the "Last or Highest" [RecordID].

Also, each customer can have up to 4 different [StockType]'s but at least 1 [StockType].So my results would look like this:

[CustomerName] - [StockType] - [CurrentBalance]
Customer#1 StockType#1 5

Customer#1 StockType#2 4

Customer#2 StockType#1 5

Customer#3 StockType#1 5

View 6 Replies View Related

Query To Show All Records Before Todays Date

Apr 22, 2008

:confused:Hi,
I'm quite new to Access, and would like help with a query.

I need to show all records with the date field 14 days before todays date.

If i havn't explained this clearly enough then i'll have another go.

Thanks

Dan

View 2 Replies View Related

Show Records That Dont Equal Todays Date!

Apr 11, 2006

One the face of it it sounds quite simple - i have a table that holds various bits of info about a customer but also a field that contains a holiday period - what i want to be able to do is show all records that do not equal todays date.

So if today was 11/04/06 - and one of my customers had 11/04/06
as one of his holiday days he would not appear on the report but all the others would.

Any help would be greatly appreciated

regards

View 14 Replies View Related

Queries :: Date / Time Query - Return All Records Of Specified Date Or Date Range

Aug 19, 2015

I have a table that has entries recorded with date and time in one field, and I want to have a query that returns all records of a specified date or date range, regardless of the time in the field.

I have tried

Code:
Between [StartDate:] And [EndDate:]

And

Code:
Between [StartDate:] & "00:00" And [EndDate:] & "23:59"

Neither of which work ....

View 13 Replies View Related

General :: Filter Data Sheet To Show Records With No Date

Mar 20, 2014

I am having trouble with a datasheet its ran from a macro button using BrowseTo command.

I am having trouble with the where condition; I would like to show records where the [FittingDate] is blank...

I have tried isnull() and [FittingDate]=""

View 1 Replies View Related

Filter Query - Report To Only Show Records With Most Recent Date?

Feb 26, 2014

I am having trouble getting a query or report to show only the most recent data.

We have salesmen that use a handheld data collector scanners to count inventory in stores. The scanner data is imported to a Access table. Each record line is one scanned item. I have a query with totals that counts the records and gives me a total count of each item at the store on that date.

I then need to filter the data to only show the most recent date. Using Max Date I get the most recent date but the count fields are showing totals for all dates. I am also getting the unique item from the earlier date in this query which I do not want.

Here is my data table: Inventory Scans from stores.

Scan Date
Item Scanned
location

1/1/2014
item123
Store ABC

1/1/2014
item123
Store ABC

......

Here is my Query with Totals that counts the item records:

Scan Date
Item Scanned
location
(Item Scanned) count

1/1/2014
item123
Store ABC
2

1/1/2014
item 456
Store ABC
3

1/1/2014
item 789
Store ABC
1

2/1/2014
item123
Store ABC
2

2/1/2014
item 456
Store ABC
1

This is what I am trying to get - only the most recent date of counted items:

Scan Date
Item Scanned
location
(Item Scanned) count

2/1/2014
item123
Store ABC
2

2/1/2014
item 456
Store ABC
1

View 5 Replies View Related

Queries :: Calculate Completion Date Of Project Based On Due Date

May 7, 2013

I am using the following expression to calculate a completion date for a project which is based on the due date. My problem that I am running into is when I get to a project that is due on a Tuesday, it returns a date for Sunday when it should be Friday.

IIf(Weekday([Due Date])=2,DateAdd("d",-4,[Due Date]),DateAdd("d",-2,[Due Date]))

View 3 Replies View Related

Queries :: Show Only Percentage Of Records

Nov 7, 2013

Is it possible to only show a percentage, like 5% of records using a query? Ideally i would like my query to show a random 5% sample from a table, that would be great. Is this sort of query possible?

View 3 Replies View Related

Queries :: Duplicate Records Do Not Show

Feb 20, 2014

How can I have this query to show no duplicate records.

I would like to only see the first record only of each stock code.

View 2 Replies View Related

Queries :: Only Show Records That Do Not Appear In Another Query

Jul 30, 2013

Currently I have a query, QRY_Test which contains a load of records under the fields "Gift_ID" and "Person_ID". I have another query, QRY_PersonList in which I would like to show all of the "Person_ID"s except the ones returned by QRY_Test.

View 3 Replies View Related

Queries :: Duplicate Records Show Only The Last One

Jun 24, 2015

I have a table and there are so called duplicate records (not entirely duplicate because there is field with the date of creation and other differences in a few fields, but from my point of view they are duplicates.). I d like to make a query which shows me only the newest record in case of duplicity.

View 3 Replies View Related







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