Date Breakdown Problem

Nov 3, 2007

Hi,

I have the following situation:

I have two fields: Start Date and Stop Date and I need to create a procedure to break them down and create records.

Start Date Stop Date
01/25/07 03/05/07

Results:
01/25/07 01/31/07
02/01/07 02/28/07
03/01/07 03/05/07

Thank you in advance for any help.

View Replies


ADVERTISEMENT

Breakdown Of Many To Many

Nov 6, 2004

I was wondering if somone could clear something up for me.

I understand that if there is a database with for example:

table_Cars(reg_num)
table_Customers(cust_num, cust_name)

there is a many to many relationship and so the inclution of

table_Order(hire_date, reg_num, cust_num)

would eliminate this.

I understand this but where I get confused is what would be done if a customer could hire out more than one car on the same order.

a Car can have MANY orders and and order can have MANY cars.

back to square one.

any guidence on this subject would be appriciated!

thanks

View 2 Replies View Related

IF Code Breakdown ANyone?

Oct 24, 2006

Ok I know people are tired of code breakdowns but I got this code in the company's database and it is suppose to calculate 2 days before the mailing date. now to Text98 is not suppose to land on a Saturday or Sunday. The problem is in the code it is somehow ending up with the same date as the mailing date. I didn't write this and I have a module from the good people here that I use for my date calculation but I am not allowed to add to the company's database. Though I can only edit.

Can someone let me know why this code is pulling the same date as the mail date?

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If WeekDay(Mail - 4) = 7 Then
Text98 = (Mail - 6)
End If

If WeekDay(Mail - 4) = 1 Then
Text98 = (Mail - 6)
End If

If WeekDay(Mail - 4) = 6 Then
Text98 = (Mail - 6)
End If

If WeekDay(Mail - 4) = 5 Then
Text98 = (Mail - 6)
End If

If WeekDay(Mail - 4) = 2 Or 3 Or 4 Then
Text98 = Mail
End If

End Sub

View 7 Replies View Related

Queries :: Check If Period Breakdown Is Complete

Aug 31, 2014

I have 2 tables:
-tblServices
-tblPricesPeriods

Each of the tables has fields for:
-StartDate
-EndDate

The logic behind the database is that each service is contracted for certain period, from StartDate until EndDate (if EndDate is not given - null - it means it is a permanent contract). For each service, we need to input prices. As prices may change during time, we may have different prices records for a service - we need to have the service period broken down into subperiods with different prices. So we need StartDate and EndDate for each period for which particular prices are valid (again, if EndDate is not given - null - it means the prices are valid "forever" into the future from the StartDate).

My problem is: I want to have a check that would return the number of services which period (tblServices) is not fully reflected in the prices periods (tblPricesPeriods). Those would be for example:

-gaps between subperiods (subperiod1 finishing 30.09.2014 and subperiod 2 starting 3.10.2014)
-service period (tblServices) limited by EndDate (not null), while prices period for this service (tblPricesPeriods) having null as EndDate
-start date for service (tblServices) earlier than earliest start date for prices periods for this service (tblPricesPeriods)
-...

Preferably, I'd like to use a normal query for that (or set of queries), but I'm opened to other options.

View 7 Replies View Related

Queries :: Complex Query Sorting And Summing Amounts Breakdown

Jan 28, 2015

I have a shell of my database in the below link for reference. I am trying to create a query for a report that will allow me to track charges and payments per client. Each charge has a ChargeID and each payment has a PaymentID. Multiple payments can be applied to one charge so the same ChargeID can show up multiple times with a different PaymentID. Payments that are catagorized as Third Party Payments will have not only a PaymentID, but a TPPaymentID.

What I need to do in the query and final report is track the total charges (even though the ChargeID may show up multiple times, I only want the charge itself to be calculated once and the charge to only be listed once for each client) and track the total payments as well as sum the total payments for each charge for each client.

View 9 Replies View Related

Reports :: Display Breakdown Of Unique Reports In The Footer

Jun 16, 2014

I am trying to produce statistics reports in my database. The user selects the information they require in a form (date from, date to etc). A query then produces the results listing each job in turn which is what I want however at the end I would like to produce sub-totals for each client.

Depending on the criteria selected by the user, only some clients will appear in the list. Ideally I would like the footer to show something like:

Client 1 - 4 jobs
Client 2 - 1 job
Client 5 - 6 jobs
Client 6 - 17 jobs

I have tried using the field:

Code:
=Count([ClientDetailsName])

However this only gives the total number of jobs.

View 6 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

Modules & VBA :: Date Field To AutoPopulate Other Date Fields To Future Date

Oct 24, 2013

I'm trying to get my "IncidentDate" field to autopopulate two other date fields to a few days from the "IncidentDate". The other two date fields are "ContainDueDate" and "RootDueDate". I'm trying to accomplish this on my "Test CAP Form"

I tried using the following in the BeforeUpdate of "ContainDueDate" and received a complier error: expected =

Code : DateAdd(d,2,[IncidentDate])

so I removed the parenthesis and nothing happened

Code : DateAdd d,2,[IncidentDate]

I even tried redoing it in the AfterUpdate of "IncidentDate" and nothing happened either

Code : DateAdd d,2,[ContainDueDate]

I'm not sure if I'm even using the right function to get what I want.

View 4 Replies View Related

Year To Date Totals, Month To Date, Week To Date

Oct 9, 2005

Can someone tell me how to get year to date totals, month to date totals, week to dates in a query? I need to get all three for three different fields.

I was not able to get the totals with the formulas given. I received the totals for each day instead. Are there any other suggestions? I am trying to different formulas, but they are not working either. I did try doing different queries with the formulas to see if that would work.

View 9 Replies View Related

Date Formatting (General Date To Short Date)

Aug 5, 2005

I am creating an online post, similar to a guestbook. When a user submits an entry, I am storing the date and time in a column titled "Timestamp", which is formatted 8/4/2005 9:16:58 ("General Date"). I am running the table through a query which is then posted on the web.

What I would like to do is this: I would like to use Timestamp to display the date that the entry was submitted, but not the time (basically, "Short Date"). Can I exclude the time using a query without changing the actual data stored in each record of the table? I understand that the time stored is completely different than the time displayed, even in the table. How can I do this?

View 2 Replies View Related

Modules & VBA :: Set Datatype As Date / Time In The Form - Update Table With Null Date

Mar 12, 2014

I have a form with Date of Death (DOD) field. I would like update DOD from a table dbo_patient into Z_Patients table.

I have set the datatype as Date/Time in the form for Date of Death.

Code:
Private Sub Update_DOD()
Dim rcMain As New ADODB.Recordset, rcLocalDOD As New ADODB.Recordset
Dim DOD As String
rcMain.Open "select distinct PatientKey from Z_Patients", CurrentProject.Connection

[Code] ....

However I am getting some error Run-time error '-2147217913 Date type mismatch in criteria expression in section below.

Code:
CurrentProject.Connection.Execute "update Z_MAIN_Processed_Patients set DateOfDeath = '" & rcLocalDOD!date_of_death & "' where PatientKey = " & !PatientKey

View 5 Replies View Related

Forms :: Date Format - Force User To Only Choose Month End Date?

Sep 20, 2013

Using access 2010; i have a form that includes a date field. Is there a way to force the user to only choose a month end date? When the user clicks the date from the popup, they may use 9/1/2013 when the mgr. want them to use only 8/31/2013. I am thinking validation field to put a msg but want to be able to force it not the option.

View 2 Replies View Related

Reports :: Showing Date Field Differently Depending On Current Date

Nov 23, 2013

I have a report that displays simple date fields. One of the fields is "lease execution". On the report, I want "lease execution" to display differently depending on the date the report was run.

So:

- If the "lease execution" date is more than 120 days away from today, I want it to display as Q YYYY.
- If the "lease execution" date is between 120 and 90 days away from today, I want it to display as MM/YYYY
- If the "lease execution" date is 90 days or less away, I want it to display the normal date MM/DD/YYYY

I was thinking I would need to do DateDiff() to figure out an amount of days that's between Now() and [Lease_Execution]. Then based on that amount make the report show it differently. Pseudocode would be: if DateDiff() = 40, then display [lease_execution] as MM/DD/YYYY

View 9 Replies View Related

General :: Deduct Quantities Based On Date - Start From Lowest Date

Sep 9, 2014

I have attached a sample of a database.

Table 1 has all the items I am trying to sell with sell by date after which I cannot sell this item. Then in Table 2 I have forecasted sales. So now I am trying to calculate stock consumption to see if I will be left with any stock that I cannot sell.

So now somehow I need to deduct sales forecast from my stock holding but it needs to go by date i.e. consume all stock for Item 1 with date 16/09 before moving to Item 1 with sale by date 23/09.

So based on the attached example, I can see that on 16/09 I will consume only 5 cases from sell by date 16/09 and another sale is 18/09. So that would give me information that I will be left with 95 items dated 16/09, which I cannot sell because they will be out of date.

Ideally I would like also to include the logic that if Item is out of date it would move to the next sell by date.

So in this case sale of Item 1 forecasted for 18/09 (94) would consume the whole stock (50) with date 23/09 and another 44 from date 01/10

For Item 2 I can see that units with Sell by date 30/09 will be consumed on 25/09 and I will start taking stock from next sell by date which is 14/10.

View 8 Replies View Related

Forms :: Auto Age Calculate From Birth Date To Selected Entry Date

May 11, 2013

I create a database through ms access and there have a birth date box and admission date. Another box for Age.I want to see the age in month or year figure in to the age box when I go next field. Which will be calculate from admission date to birth date.

View 1 Replies View Related

Modules & VBA :: Add 7 Days To Todays Date To Store Target Date In Table

Dec 9, 2014

How can I add 7 days in todays date to store target date in the table?

Code:
ssql = "Insert into tblUpdate([Update_ID],[Date],Username,Status,Target_Date) values('" & j & "',#" & Format(Date, "mm/dd/yyyy") & "#,'" & k & "','Open')"
CurrentDb.Execute ssql, dbFailOnError

View 3 Replies View Related

Display Fields As Column Showing Date One Month After The Date In Field Above

Jun 2, 2015

I am creating a repayment schedule (as a report) and I want to display a series of fields as a column which return (show) a date one month after the date in the field above.

The first repayment date field (Line 1) will show a date one month after the loan was paid out. the Next field below will show the date one month later.

I can't simply insert the "Date + 30" because that would get out of since over the year. If the loan was issued on say the 15th of January, I need the first field to display 15th February and the next would be .... 15th March.... Yes - You've got it!

Now I could do that in Excel, but I don't know how to get Access to do it.

View 4 Replies View Related

Calculate Final Date Based On Begin Date And Number Of Days

Jun 30, 2015

I need to calculate the final date based on the begin date and the number of days.

The name of the fields are: sdatainicio; diasatribuidos; sdatafim.

View 7 Replies View Related

Find Max Random Date In Tbl1 Before Active Record Date In Tbl2

Jul 9, 2013

I'm reworking a db to make it web compatible. Right now I'm working on my Price and Sales tables.There are about 900 Sales records, 450 Price records (for about 45 Items).

I have re-done my Price table with an Autonumber Key field. (It had a multi-key which I understand web db does not support.) Each autonumber key represents a Date with new Price for a Company/Item. The Price change Dates are random.

I have put a Foreign Field in my Sales table for the Price key field.

My dilemma is matching the Sales with the Prices.

When the Price Date and Sales Date do not match (at least half of them don't match), I need to look back in the Price table to the max Date BEFORE the Sales Date in the Sales table for that Company/Item in order to select the correct Price key.

View 2 Replies View Related

Auto Fill Field In A Table By Comparing A Given Date Against Current Date?

Aug 18, 2015

I am building a database to track contract of employees so that I can know which contracts are valid and which are expired.

My table has the following fields:

ID (Primary key)
Employee ID (Foreign key to link to the employee table)
Start_Date
End_Date
Status (Either valid or expired)
Challenge

I want when I enter the end date, the system checks the end date against the current date and fills in the status field with either valid or expired as appropriate. For instance if the contract end date is March 10,2016, the status must be filled in the word valid.

View 3 Replies View Related

Forms :: Form Auto-populates Date Field - Want To Add Check Box To Enter Alternate DATE

Nov 1, 2013

We use access to enter our service tickets in at work.What we have are three date fields.

Call Date
Start Date
End Date

We are 24/7 operation.Currently all 3 just autopopulate with the current date.What i would like to do is ADD a CHECKBOX next to each Date Field.And make it work like this.

1. let them autopopulate as they are currently
2. if you end the call AFTER MIDNIGHT (the next day). CHECKING the box would automatically populate yesterdays date in each of the fields that has the check box CHECKED

View 3 Replies View Related

Print Date Range On A Report Based On A Non-date Field

Aug 7, 2005

Is there a way to show the earliest and latest dates of a report generated by a non-date field?

E.g. I generate a report based on Food, and it'll list the days that this food is associated with. Is there a way to show the first and last day that appears in this report (i.e. the range of dates that the report shows based on the food selected)

View 2 Replies View Related

Question About Searching For One Date Accross Multiple Date Fields. Thanks!

Jan 12, 2007

I am currently building a booking and invoicing database for the small business where I work. One aspect of this database allows you to enter an employee name and schedule days off via a form I have already built. To access this information I would like a parameter query where you can enter a date once and then have this date looked up across a number of date fields. Here are my table column headings:

ID
Employee Name
Date 1
Date 2
Date 3
Date 4
Date 5
Date 6
Date 7
....etc

So, basically, the parameter query would ask "What date?" which the person would enter, and then search all 12 date fields to see if the date was contained in any one of them. Then it would pull any records which did have the date in one of the fields.

It seems really simple but I have searched and searched and can't seem to find the answer. Tried a multivalue field but does not seem to work.

Thanks very much, any help appreciated! Elspeth :confused:

View 14 Replies View Related

Query Date From DateTime - General Date Format Field.

Mar 10, 2006

I have a date and time stamp in a Date/Time field of General Date format (3/1/2006 7:52:25 AM).

I wish to select query on the table's Date/Time field by date portion only (3/1/2006) and not include the time portion (7:52:25 AM) of the field.

Using this expression in the query's criteria - "Between [Enter Start Date: (MM/DD/YY Format)] And [End Date: (MM/DD/YY]" will not return the date ranges as desired without also typing in the full time string.

How can the date integer be parsed out and the query properly expression ed on the criteria field without using VB?

View 7 Replies View Related

Forms :: How To Categorize Quarters Based On Start Date And End Date

Jun 23, 2015

I have a DB with Start Date (dd.mm.yyyy), End Date (dd.mm.yyyy) and Quarters. We have 4 Quarters (Jan-March, April-June, July-Sep, Oct-Dec) and extra columns of month (xxx) and year (yyyy) too.

The problem is the front end users have access permissions to modify the dates. if they change the start date and end date then they are manually gonna change other fields like quarter, month and year too (Which they don't want). The users don't need to manually update the column values for Quarter, Month and Year

For Example,

If the user modifies Start Date to: 22.05.2014 and End Date to: 24.06.2014 (then the quarter column should be fixed to 2nd quarter and month should be June and year should be 2014).

2nd Example: We need to consider the End Date for classifying the quarters, Month and Year

If the Start Date is: 22.05.2014 and End Date is: 24.12.2014 (then the quarter column should be fixed to 4th quarter and month should be December and year should be 2014).

The solution is when ever the front end user modifies the dates then automatically the quarter, month and year columns need to be changed.

Sample piece of Access data sheet with just 3 examples. Column names Start date, End date, Quarter, Month, Year.

View 11 Replies View Related

Queries :: Set Up Query Which Responds And Filters By Date (Older Than X Date)

Jul 11, 2014

I currently have a query set up which responds and filters by the date.

I use the current code in the criteria on the query for todays date less 7 days

Code:
DateAdd("d",-7,Date())

This works perfectly and I had no problem with it. However I need to adjust the criteria so it is less than 7days ago OR OLDER....

How would I go about doing that?

View 4 Replies View Related







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