Yet Another Thread On Date Queries

Jun 28, 2005

I have a table that stores date/time in the Now() format, but I want to run a query that will format the date/time in "mm/yyyy" with MSAccess SQL.

Here is an example table:

Table1
------
IDDate
11-Dec-2004 12:24:06 PM
24-Apr-2005 5:04:18 PM
38-May-2005 8:13:52 PM
413-May-2005 2:27:57 PM

Here are the desired results:
Table1
------
IDDate
112/2004
204/2005
305/2005
405/2005

View Replies


ADVERTISEMENT

Sum Thread

Mar 9, 2006

I have database where users can produce a quote. Each new quote gets a quote number,
when users add a item to the quote, they also add a DHR (daily hire rate)
The table records the item and adds the quote and the DHR.

I want to run a query so it shows the quote number and adds all the DHR's for that quote.
Can this be done in a query as an expression.

View 4 Replies View Related

Deleting A Thread

Mar 14, 2008

An individual posted a new thread today (3/14/08) (believe it was in the General Section) asking for a help with a UDF that wouldn't process. He received one response, then I came in with another response which I later edited to include more info. Saved it, checked back to ensure it was what I wanted -- it was.

Closed the browser, shut down the computer. When I later reopened this site, the thread was missing entirely. Did a search on my recent posts -- it's not there.

I'm baffled -- how does a thing like that work?

Bob

View 3 Replies View Related

Difference Between Post And Thread

Mar 15, 2007

Hi guys am not sure if i got dis in d correct forum (forgive me if not)

Just wanted 2 know what's d diff btwn a thread & a post (if d's any)

Noks

View 6 Replies View Related

Yet Another Insert Image Thread

Mar 10, 2005

Hello,
Although, I have seen many threads in regards to displaying images in forms, I have not been able to find exactly what I'm looking for.

The solution I am looking for is to give the user the ability to browse for an image, select it and insert it into the form. From reading these forums and playing around with Access, one thign I am sure about is that I want to link the image (I couldn't believe how bloated access gets when embedding an image).

I thought of a great solution for linking images, but I have no idea how to achieve this. (This solution, in my opinion would be great not just for images, but for all kind of objects).

Since I am linking the image, I would like to be able to store the image in a "private database" folder, that way the image will not be tempered with. It is my understanding that if I wanted to do that, I would have to first place the images in that folder and then actualy insert them into the form. This seems kind of pointless to me, since it will create extra work for the user.

So basically what I would like to do in pseudo code is:

On Click, browse for image
on image select, save image to \database image folder
link image to \data image folder
display image in form


I think this would work really well for all kinds of document management (not just images) allowing the users to attach pdfs/images/documents to records with out worrying where they are stored, and knowing they will not be tempered with (I'm planning to place the folder somewhere on the server)]

Any ways, any help woudl be greatly appreciated, and if I do manage to come up with a solution on my own, I will be sure to post it here.

View 1 Replies View Related

My Last Thread Today, I Promise!--go To Record By Id

Jun 10, 2005

hello once again,
i'm using this code to go to a certain record in a table:

Dim strRecord As String
strRecord = Me.List26.Value
DoCmd.GoToRecord acActiveDataObject, "Stopwatch", acGoTo, strRecord

the problem with this code is that it goes to the record number, not the id.... how can I tell it to go to the record it (primary key) instead of the absolute position number of that record?

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

Another "what Kind Of Query Is This" Thread

Oct 22, 2007

I have a Customer table in an Accounts Receivable late-payments database that has very basic fields:

CustomerNumber, Name, BillToAddress1, BillToAddress2, City, State, Zip, Phone

As we get changes from new invoicing activity, I need the table to update the contact info. So, we get a spreadsheet each day with new invoicing activity, some of which will already have customers in our database. I need to capture any new addresses or other contact information to update my current records. We append the new info to the Invoices table, then need to grab the new addresses and update the Customer table.

I don't know why I don't know how to do this, as it seems so simple. Any help is greatly appreciated.

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

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 :: Date Field With Time - Query For Date Only And Get All Records

Apr 26, 2013

I have a query based on a table which has a date field. the field both in the table and the query have the time also in the date value so when I try to query on a date I get nothing if I copy the date and time from the field I will get the result for that record if I just use the date I get nothing. I have tried the format which does display just date but if you click on the field the time is also there You must be able to query for a date only and get all the records.

View 11 Replies View Related

Queries :: Date Filter - If Date Is In A Future Month

Apr 20, 2015

I've two fields to work with:

[Date of Device]
[DischDate]

If i was explaining it, it would be as follows:

If [DischDate] Is in the next month after [Date of Device] then Y else N.

to add for example if the [Date of Device] is April 2015, and the [DischDate] is also April then i'd expect a N answer

to add for example if the [Date of Device] is April 2015, and the [DischDate] is May then i'd expect a Y answer

View 2 Replies View Related

Queries :: When Date Null Return Today's Date

Aug 8, 2013

I have a query where I display the [OPEN DATE] and [CLOSE DATE] of my cases. However, when I run this query sometimes the cases are not closed yet, therefore there are null values. However, I also have a field to calculate the datediff between these two dates. I need the [CLOSE DATE] field to display today's date when it is a null value so that I can still get a count of the days using datediff when I run the query.

View 1 Replies View Related

Queries :: Hiding Date Picker From Date Fields

Nov 5, 2013

The query is there to query data, not to edit data or manipulate data in anyway. However, I am disgusted by the appearance of the date picker when I pick a field that is a date field.

Is there a way to hide/remove these date pickers from the query sheet?

Within the table itself I turned the "Show date picker" property to "Never" but that didn't make a difference.

View 2 Replies View Related

Queries :: Start Date And End Date Query?

Mar 26, 2013

I've attached a stripped down version of a small order database I'm working on.

A user would enter an order, the amount and the date the order is required by.

As you can see from tbl_seasons, the business has financial periods that match the first and last 6 months of each year. Each season has a start date and end date.

What I'm trying to build are two queries:

1. A query which lists all orders and has an extra field which shows the "season_id" that the order (date) relates to (based one the start date and end date in tbl_seasons)

2. A totals query which shows the total order amounts by season

how I might build these 2 queries.

View 2 Replies View Related

Queries :: Crosstab Queries - Export Command Ask To Enter Date Parameter Twice

Feb 24, 2015

I have a crosstab queries which uses the date query parameters. However, when I go to my Export command (code is below), it ask me to enter the date parameters (start date and end date) twice. What do I have to do so that the system will ask me to enter once only?

Code:
On Error GoTo Err_cmdTest_Click
'Must 1st set a Reference to the Microsoft Office XX.X Object Library
Dim dlgOpen As FileDialog
Dim strExportPath As String
Const conOBJECT_TO_EXPORT As String = "qryEXPORT"

[Code] .....

View 9 Replies View Related

Queries :: How To Export Crosstab Queries By Date Parameters

Feb 23, 2015

How can you export cross tab queries by using date parameters (for example: Jan 1, 2014 to December 31, 2014)...

View 3 Replies View Related

Queries :: Access Multiple Queries Run With Date Parameter

Jun 19, 2015

I have 5 queries that I am running. The first query has the date range parameters set in the field area that I need to run and each additional create table query is based off the results of the previous query.

1. Which is better to use to run all of the queries in one simple step? A macro or a form? I am exporting the final table to excel so that I can make some additional adjustments off of it.

2. How would I setup the date range parameters for the first query if I were to use a macro without going into the query itself and updating the date field? I tried setting up a macro to run the queries by using the OpenQuery action for each of the 5 queries, but I cannot figure out how to do the date range.

View 11 Replies View Related

Queries :: Dlookup Value From 1 Table With Date Ranges From Diff Table With A Single Date?

Mar 12, 2015

i have 2 tables.. 1 with bookings and 1 with a BonusPeriod range.

in the Bookings table there is a field called [ServiceDate]

in the bonus table i have a field called [Period] which is text i also have 2 dates, [StartDate] And [EndDate] i need to Dlookup the Bonus table to return the value of the period table based on where the [ServiceDate] falls.

i dont want to use VBA (i really need it to work within a query that inserts it's data into another table)

i've tried everything but had no joy

Expr1: DLookUp("[Period]","BonusPeriods","[ServiceDate]" Between "#[StartDate]#" And "#[EndDate]#")

Expr1: DLookUp("[Period]","BonusPeriods","[Staff_BookingsAndQuotes_Master].[ServiceDate]" Between "#[StartDate]#" And "#[EndDate]#")

Expr1: DLookUp("[Period]","BonusPeriods","(FormatDateTime([ServiceDate]),"yyyy-mm-dd") Between (FormatDateTime([BonusPeriods]![StartDate]),"yyyy-mm-dd") and (FormatDateTime([BonusPeriods]![EndDate],"yyyy-mm-dd"))))

View 10 Replies View Related

Queries :: Getting Date / Time Range - Date And Time Are Separate Fields

Mar 13, 2014

I have a database with date and time each stored in a separate field. Now I want to query the database based on a start date/time and an end date/time. I started with the code below but it only returns events within the same time range on each day when what I really need is every event from a specified date and time through a specified date and time.

SELECT myTable.ID AS myTable_ID, myDate, myTime, FirstName, LastName
FROM Staff INNER JOIN myTable ON
Staff.ID = myTable.StaffID
WHERE myTable.myDate >= #3/2/2014#
AND myTable.myDate <= #3/3/2014#
AND myTable.myTime >= #8:00PM#
AND myTable.myTime <= #11:00PM#
ORDER BY myDate desc

In the above example what I want is every event from 3/2/2014 8:00PM until 3/3/2014 11:00PM. But what I get instead is every event between 8:00PM and 11:00PM on 3/2/2014 and every event between 8:00PM and 11:00PM on 3/3/2014.

View 4 Replies View Related

Queries :: Find Date In Table 1 Closest To Another Date In Table 2?

Mar 17, 2015

I have a table, tblVisits, holding patient's pre and post surgery visits:

Code:

PatientID VisitDate
1 1/5/12
1 3/10/12
1 9/1/13
2 ...

And another table holding patient's surgeries (each patient will have only one surgery)

Code:
PatientID SurgeryDate
1 4/1/12
2 ...

I need to compare these two tables and create a variable that indicates which pre-surgery visit date (i.e., VisitDate < SurgeryDate) is closest to the surgery date. In the above example, it would return:

Code:
PatientID VisitDate ClosestToSurgery
1 1/5/12
1 3/10/12 Yes
1 9/1/13
2 ...

I've tried various MIN and MAX approaches and can't seem to get it right.

View 2 Replies View Related

Queries :: Using Max With A Date?

Oct 8, 2013

I have a query where the intent is to return the most recent Statement Closing Date by Account Identifier.This works great

SELECT [ME - Balances and Activity at Cycle End_Updated].[Principal Bank Identifier], [ME - Balances and Activity at Cycle End_Updated].[Account Identifier], [ME - Balances and Activity at Cycle End_Updated].[Member Number], Max([ME - Balances and Activity at Cycle End_Updated].[Statement Closing Date]) AS [MaxOfStatement Closing Date]
FROM [ME - Balances and Activity at Cycle End_Updated]
GROUP BY [ME - Balances and Activity at Cycle End_Updated].[Principal Bank Identifier], [ME - Balances and Activity at Cycle End_Updated].[Account Identifier], [ME - Balances and Activity at Cycle End_Updated].[Member Number];

However, when I introduce variable data, such as a balance field where the balance is different every Statement Closing Date, I get everything.

My question is how do I get my query to return just the most recent Statement Closing Date, regardless of the variable data?

View 2 Replies View Related

Queries :: Date Query To Match Other Date Query?

Nov 3, 2014

running 3 queries together.

1 qry has a date parameter of start/end date(running before the 3 are together)

Have a field in 1 of the 3 queries with a date field that I need to show being <= the date parameter...

How/where do I use this criteria?

View 3 Replies View Related

Date Parameter Queries

Jan 9, 2006

Hi everybody,

I have a report that is based on an underlying query.At the query level,I
want to define parameters of date data type so that records to be displayed
should fall between DateA and DateB. ie Between[Enter Date A:] And [Enter Date B:].
I want the DAteA and DateB to be only days and Months of a year.

Say my DateA = 01 Jan 06 and my DateB = 31 Dec. 06

But I want only the Parameter to be Between[Enter day and Month A:] And [Enter day and Month B:].


How can I write a query with the two parameter values?

Thank you

dfuas

View 1 Replies View Related

Date Problems In Queries

Oct 4, 2007

I have a query that pulls out a date. It's value is 05/10/2007 as DD/MM/YYYY

Then I do a basic sql statement via a recordest with this code

UPDATE TempValues SET LastShippingDate = #05/10/2007#

The problem is the way it gets stored in the table. I see it as 10/05/2007 DD/MM/YYYY.

The format field for that field is short date DD/MM/YYYY. Regional setting for this computer is DD/MM/YYYY.

Totally at a loss on this one :(

View 4 Replies View Related

Date Queries And Wildcard

Jan 24, 2007

Hi
I am looking for ways to sort date columns.
Something like find all in one particular month, or year.

I know i have done this before to sort data into monthly queries,
but now i have forgotten
>> something like ="#*/7/*#" to sort all date on the 7th month.



By the way I cannot seem to get access to format dates in the
dd/mm/yy format, does anyone know if there is an option for this.

cheers

View 2 Replies View Related







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