Silly Date Question

May 1, 2008

ok guys i know this is really stupid and silly but i cant see for the life of me what i am doing wrong i have a query where i want to only show records between to dates (including first and last)

when i do both or less than one date nothing shows using the code below
SELECT Sum(HTRXTBL.HTRX_QTY_1) AS QTY1,
Sum(HTRXTBL.HTRX_VALUE) AS VALUE1,
DateDiff("d",[Forms]![frmCOMPARISON]![txtDATEFROM1],[HTRXTBL]![HTRX_TRX_DATE]) AS [DAY]
FROM ITEMTBL INNER JOIN HTRXTBL ON ITEMTBL.ITEM_NUMBER = HTRXTBL.HTRX_ITEM_NUMBER
WHERE (((HTRXTBL.HTRX_REC_TYPE)="ITMSALE")
AND ((HTRXTBL.HTRX_TRX_DATE)>=[Forms]![frmCOMPARISON]![txtDATEFROM1]
And (HTRXTBL.HTRX_TRX_DATE)<=[Forms]![frmCOMPARISON]![txtDATETO1]))
GROUP BY DateDiff("d",[Forms]![frmCOMPARISON]![txtDATEFROM1],[HTRXTBL]![HTRX_TRX_DATE]);

when i do greater than the from date it this code below works
SELECT Sum(HTRXTBL.HTRX_QTY_1) AS QTY,
Sum(HTRXTBL.HTRX_VALUE) AS [VALUE],
DateDiff("d",[Forms]![frmCOMPARISON]![txtDATEFROM1],[HTRXTBL]![HTRX_TRX_DATE]) AS [DAY]
FROM ITEMTBL
INNER JOIN HTRXTBL ON ITEMTBL.ITEM_NUMBER = HTRXTBL.HTRX_ITEM_NUMBER
WHERE (((HTRXTBL.HTRX_TRX_DATE)>=[Forms]![frmCOMPARISON]![txtDATEFROM1])
AND ((HTRXTBL.HTRX_REC_TYPE)="ITMSALE"))
GROUP BY DateDiff("d",[Forms]![frmCOMPARISON]![txtDATEFROM1],[HTRXTBL]![HTRX_TRX_DATE]);

:( i cant see what is different or missing help please

View Replies


ADVERTISEMENT

Please Help Out A Silly Prat With A Simple Date Question

Sep 16, 2005

I have the following fields in a query: "Employee_number", "shiftname", and "shiftdate"
And I have the following code on the criteria of "shiftdate": >= dateadd("d",-7,Date()) so that only records from the past 7 days are displayed which is fine, however when I run the query it displays the following

Employee_numbershiftnameshiftdate
1A16/09/2005
2A16/09/2005
3B15/09/2005
4B15/09/2005

which is not quite what i want.....Is it possible to make it only show the same shiftname with the same shiftdate just the once instead of showing it several times for each employee?

View 4 Replies View Related

Silly Question

May 24, 2005

Erm, can someone tell me how to add a new record to a table pls?

I cant find how to do it in the heklp section

Many Thanks

Andy

View 8 Replies View Related

Silly Question....

Sep 26, 2005

i've got a field in a form where u need to pick gender(in dutch)
Now there's an Attention further on and i need the proper attention:(in english= Male=Sir,Female=Madame) Which is in dutch: Male= M = De heer
Female = V = Mevrouw, Unknown = O or B = De heer/mevrouw, So my code became:
=IIf([Geslacht];"M";"De heer";(IIf([Geslacht];"V";"Mevrouw";"De heer/mevrouw")))

Can some1 please tell me what i did wrong?


Kind Regards
SilverBlood

View 1 Replies View Related

Confused, May Look Silly Asking This

Mar 21, 2006

hey guys

I want to creat something like

1. list of all countries, with one Bogus "All" representing all countries

2. When i select a Country from drop down list, i should get list of States in that Country. Again with one Bogus "All" representing all States in that Country

3. When i select a State from drop down list, i should get list of Cities in that State. Again with one Bogus "All" representing all Cities in that State

Can anyone suggest to find solution

Thank you

View 1 Replies View Related

A Silly Problem! :)

Nov 23, 2006

Hi fellas,

thanks for all ur help in my previous posts.......

ive got this problem, ive got a form that provides mobile details.

on the same form theres an add button and clear button.

all the validations work....... if the forms incomplete then validations do occur.

but the problem is......... if i clear the form (clickin on the clear button) and click 'x' to exit, it brings up one validation, which is the date_issued field validation????? and then exits

why does this validation occur??? how do i get rid of it.............

i want it to exit without any problem....... becoz i have cleared the form

View 14 Replies View Related

Silly Question From A Newbie

Oct 25, 2007

Hi there,

I have been using Excel for many years and have just got to the stage where I need to build a database. I have managed to work out how to import the data ok but within the single table that I will be using I need to have a column which will add up the contents of four other columns.

EG.

Cells in Column T to be the total of cells in the same row from columns C, E, F and G.

Please would someone be kind enough to let me know if this can be done and if so how I can go about achieving this.

I am a newbie so please be gentle with me!!

Many thanks.

Paul

View 4 Replies View Related

Here Goes - New Access User With Silly Q

Nov 10, 2006

I have read as much as I can about using access and have decided it's time to have a play - so please forgive me if this is a silly question. Here goes.

I have a single table - it lists staff by name and staff number and shows 3 qualifications that they may or may not need (yes/no columns).

I have managed to produce queries/reports that show, for each of the 3 qualifications whcih personnel that require that qualification have not achieved it.

I now want to produce a query/report that lists any personnel that are outstanding any of their required qualifications and if so which qualification they are outstanding.

Any hints or tips would be very much appreciated.

View 3 Replies View Related

Silly Query Problem

Mar 6, 2008

I'm probably doing something daft but can anyone suggest why this query is giving no results?

The Item_Type field in the TBL_All_Items is a drop down menu

The query Q_Printers is supposed to be giving the results of only those item types beginning PRN but its showing no results.

View 5 Replies View Related

Really Silly Access Question

Jun 6, 2007

I feel like a goober for even asking this, since I've been using Access for three years now for work-related databases, but this is actually the first time this has come up and I can't, for the life of me, figure it out.

I need to find out if there is a way to copy something (a year, for example) and paste that one thing onto multiple rows within one column of the datasheet (Year Attended, for example.)

I don't want to have to type in the year 1,296 times; I'd like to see if I can highlight the portions of that column I want (all of the people who attended in 2005) and paste "2005" into all of the highlighted cells at once. In Excel, for example, you can copy something, highlight an entire section, and it will paste into each cell.

Any help would be appreciated!

View 2 Replies View Related

Silly Problem With Finding A Control

Dec 15, 2005

Hey all,

I have this code on a number of difference forms:

[Forms]![Care Packs].Customer.SetFocus

This is executed by an event in another form that loads the new form and starts dumping in values. For some reason I'm suddenly getting "Object doesn't support this property or method. 'Object' is simply a textbox that is enabled, but is also locked altho to my knowledge this isn't a problem. It's late and I've been working for hours so this may be something simple I've overlooked...need to step away for a while.

Any thoughts?

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







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