Problem Finding Mismatched Dates

Sep 30, 2005

Hi,
I am trying to find entries in Table A, that do not have a corresponding entry in table B, based on mismatched dates. Both tables can have multiple entries for several fields in each table. The problem is that there are dates in Table A that do match dates in Table B. It appears as if the query is comparing data row by row, not by data field. The sql for the query is as follows:

SELECT AE1.CSUBJECTID AS Patient, UCase([AEEVENT]) AS [AE Term], AE1.ONSETDT AS [AE Onset Date], AE1.ONSETTM AS [AE Onset Time], MI1.MI_DATE AS [Date of MI], MI1.MI_TIME AS [Time of MI]
FROM AE1 INNER JOIN MI1 ON AE1.CSUBJECTID = MI1.CSUBJECTID IN '\tmcnjfp1projectsData ManagementACUITYNew DataAcuity Revised DumpsAcuity_Revised_Access.mdb'
WHERE (((UCase([AEEVENT])) Like "*CHEST PAIN*" Or (UCase([AEEVENT])) Like "*CP*") AND ((MI1.MI_DATE)<>([ONSETDT])))
ORDER BY AE1.CSUBJECTID
WITH OWNERACCESS OPTION;


The problem I am having is shown below:

PatientAE TermAE Onset DateAE Onset TimeDate of MITime of MI
64001067CHEST PAIN08-Dec-0423:1004-Dec-046:00
64001067CHEST PAIN07-Dec-043:0704-Dec-046:00
64001067CHEST PAIN08-Dec-0423:1014-Dec-0422:35
64001067CHEST PAIN07-Dec-043:0714-Dec-0422:35
64001067CHEST PAIN04-Dec-0422:4014-Dec-0422:35


As you can see there is an AE Onset Date of 04-Dec-04 and a Date of MI of 04-Dec-04. So, is the query going row by row (e.g. first row ---> 08-Dec-04 <> 04-Dec-04). Any help is greatly appreciated.
Bob

View Replies


ADVERTISEMENT

Finding Dates In The Future

Oct 12, 2005

I have a table that holds the info on our fleet of company vehicles. One of the fields in the table is called ServiceDueDate. I want to be able to set up a query that shows any vehicles that have a service due in the next 30 days.

I know I'll need to use DLookup in there as well as Date - 30 but not sure exactly how to write the query.

Any help would be greatly appreciated.

View 3 Replies View Related

Finding Records Between Dates

Jan 4, 2005

Hello, i need to have my database find records that were entered between two dates. To do this i made a query that included the dates the records needed to be in between....[date1] and [date2]. Then i had the record dates be called [sent date]. i made my query and in the criteria for [sent date] i wrote
(Between [Date1] And [Date2])
when i enter the two dates [date1] and [date2] the query does not show the records that are between that date. why is this happening? is there and easier way? another way?
For example, say that i have records with their [sent dates] equaling 12/30/2004, 1/1/2005, 10/1/2005
i want to make it so that when the user inputs a records with dates [date1] and [date2], that those records will show up if their [sent dates] are between [date1] and [date2]. if [date1] is 1/1/2003 and [date2] is 1/1/2006, all of the records will show up.
if [date1] is 12/31/2004 and [date2] is 1/3/2005, then only the record with the date 1/1/2005 will show up.
how can i do this?

View 5 Replies View Related

Queries :: Finding Records Between Dates?

Jun 4, 2013

I have a table tbl_PolicyDetails with details of the policy the customers have with us.. In the tbl_PolicyDetails, I have two fields (these are the ones in question) called

"policyStarted" - Start Date of a Policy and
"policyPeriod" - Term of Policy Monthly/Annually/Quarterly

So in a Form view I just get the Next installment for the customer based on this information for display.. For example..

Mr Butters Stotch's policy started on 26/04/2013 and is paying Quarterly; the next (i.e. 2nd) installment would be on 26/07/2013..

Ms Wendy Testaburger's policy started on 07/04/2013 and is paying Monthly; the next (i,e. 3rd) installment would be on 07/06/2013..

This is not hard to get.. I have that sorted.. But the problem is, my manager wants to be able to specify two dates and search all policies that will be 'paying in' that Date range should be picked up..

So if the search range happens to be.. 01/07/2013 and 31/07/2013 Then Mr Butters Stotch's policy should be picked up, as his next installment falls on 26/07/2013.. Since this information is not stored, I cannot run a direct Query on this.. Also as the Installment number varies for each customer, I would not be able to just add 1 - Month or Quarter or Annum, and see if the date falls in that range..

View 2 Replies View Related

Queries :: Finding Booked Vehicles Between Dates

Apr 15, 2013

I have a Table with Date Booked From and Date Booked Till

I want a query to show all booked vehicles between the dates in a parameter query, I thought I solved the issue but this is not the case

I am using the following codes

DateFrom - >=[ENTER Start Date]
DateTill - <=[Enter End Date]

All works fine but I have noticed if I put in the

start date 01/01/2013 and End Date 07/01/2013

if there is any vehicles booked between these dates E.g. 03/01/2013 - 05/01/2013, they wont show up.

how can i get round this problem?

View 14 Replies View Related

Mismatched Data Type Error #3464

Apr 28, 2008

Hello All,

I changed one of my queries to generate the period off a date in a field. The simple expression is:

Period: Month([Act Del])

It give me the number of the month...however now I am getting this error. I assume that the number of the month is not matching with the other data types....but I need to know who to fix it.

any ideas?

Thanks

View 4 Replies View Related

Queries :: Mismatched Data When Query From Main Form With A Count

Feb 9, 2014

I have Main Table with a count and I have a query from it. But when I looked at it, the data doesn't match. What may seems to be the problem? It is all Grouped By.

View 1 Replies View Related

Modules & VBA :: String And Date - Data Type Mismatched In Recordset Filter

Jan 10, 2015

I am trying to filter a recordset with a variable q. The field in the table associated with the record set is of data type Date/time. I assigned data types String and Date to q but both cases generates the error message " Data type mismatched in expression".

View 10 Replies View Related

Forms :: Dates As Column Headers To Update Table With Dates As Rows

May 12, 2014

Any way to have a form with Dates as column headers to update a table where the dates are stored in rows???

The table set up is like this:
tblOpHdr
DiaryID (PK) - OpDate (Date)

tblOpDetail
DiaryID (FK) - CostCode - MachineNumber - MachineHours - etc

I'm just wondering if there's any way I can do this with a datasheet or a crosstab type setup?

It's Access 2010.

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

Queries :: Access 2007 - Select All Dates Between Two Dates?

Apr 9, 2015

I have a table of records, which has within it two date fields (effectively, a 'start' and 'end' date for that particular record)

I now need to create a query to perform a calculation for each date between the 'start' date and the 'end' date

So the first step (as I see it anyway) is to try to create a query which will give me each date between the two reference dates, in the hope that I can then JOIN that onto another query to perform the necessary calculation for each of the returned dates.

Is there a way to do this?

So basically, if for a particular record, the 'start' date is 01-Apr-2015 and the 'end' date is 09-Apr-2015, can I produce a dataset of 9 records as follows :01-Apr-2015

02-Apr-2015
03-Apr-2015
04-Apr-2015
05-Apr-2015
06-Apr-2015
07-Apr-2015
08-Apr-2015
09-Apr-2015

(The *obvious* solution would be to create a separate table of dates, from which I could just SELECT DISTINCT <Date> Between #04/01/2015# And #04/09/2015# - but that seems like a dreadful waste of space, if that table is only required to generate the above? And it would have to cover all possible options; so it would either have to be massive, and contain every possible date - ever! - or maintained, adding new dates as necessary when they are required. Seems horribly inefficient!)

Is it possible to just select each date between the two reference dates? Or can you only query something which exists somewhere in a table?

View 4 Replies View Related

Subtracting Dates From Adjacent Dates In Same Column

Sep 7, 2006

Hiya-

I have a database with 5000 entries, corresponding to about 10 entries for about 500 people. Each of the entries is dated, and I need to calculate the time intervals between each person's sequential entries in the table.

One way of doing this is to create another column that contains the date of the previous entry. I can then use DateDiff to subtract one date from the other and give me the difference in days.

This approach falls down if I then work with only a subset of the entries - I would have to re-enter the previous entry dates as the time intervals would have changed.

What I really need is a way of subtracting the date from the date in the cell directly above it. Will Access let me do this, or is there a better way?

Many thanks, Jules.

View 3 Replies View Related

Queries :: Count Dates Between Dates In Two Tables

Jul 8, 2014

I have two tables with dates. Between (!) every two following dates in table1, I want to know the number of dates in table2. How do I write an SQL query for this? The tables I have are up to a few hundred records in table 1 and a few thousand records in table2. So to prevent that this takes hours I need a fast query.

To explain the query I need, for example:
table1
01/01/2014
15/01/2014
17/01/2014
30/01/2014

table2
01/01/2014
02/01/2014
05/01/2014
17/01/2014
18/01/2014
20/01/2014
21/01/2014
25/01/2014

So the answer of the query would be 2,0,4.

Explanation:
Between 01/01/2014 and 15/01/2014 in table 1 there are 2 dates in table2 (01/01/2014 is not included between the dates)
Between 15/01/2014 and 17/01/2014 in table 1 there are 0 dates in table 2
Between 17/01/2014 and 30/01/2014 in table 1 there are 4 dates in table 2

View 2 Replies View Related

Summing Data Between Two Dates (When Dates Are Different Per Record)

Nov 15, 2011

I have a master table which shows all transactions per record (person) over a financial year.

Each record person has a seperate package period over which their spend needs to be measured. Therefore although I have all their transactions for the year, I only want to sum their transactions between their given [start date] and [end date] which are in columns.

I need to be able to create a field which sums all expenditure per record between the start and end dates

Name Start Date End Date Invoice Date Amount

Matt 15/5/11 15/9/11 1/11/11 £100
Matt 15/5/11 15/9/11 7/7/11 £200
Matt 15/5/11 15/9/11 12/12/11 £200

In this case I would only want to sum 7/7/11 as this is between the start and end dates

I want to write something like sumif([Invoice Date] is between [start date] and [end date] - not sure where or how exactly

(The start date and end date will always be the same per person)

Is this possible in access?

View 10 Replies View Related

Returning All Dates Between Two Dates In The Same Record?

Nov 3, 2005

Hi,

Please bear with me here as it's a little involved.

I'm doing a staff profile website which includes a section where they can enter their annual/other leave details.

I decided to store their leave in two fields Start_Date | End_Date rather than each individual date that they took - the short and wide approach vs long and narrow.

This has left me needing to do a query that would return all the dates between the start and end dates inclusive.

Example:

StaffID---Start_Date---End_Date
---1-----12/12/2004--14/12/2004

Returns:
StaffID---Leave_Dates
--1-------12/12/2004
--1-------13/12/2004
--1-------14/12/2004


I appreciate i could do this using some script to loop through a recordset and build an array of dates but i wondered/hoped that it could be done using SQL.

As it is an asp page i can't use user defined functions in a VBA module in Access so the solution would need to be pure SQL.

Is this possible?

Any help v.much appreciated.

TS

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

Finding Help?

Aug 21, 2007

Hi all:)

I am looking for some advise, I work for a small service company and we our trying to computerize our service jobs through the use of access 2007, We have completed 80% of the database but are having a few problems completing, for example the search function on some forms etc, I have searched the web for help and have posted the problem on this forum a number of times but I am still unable to get it to work myself as I am new to access , the problem is I need the database completed asap before we take on a bigger contract and I am running out of time, so I was wondering if anyone knew of anyone / or any company out there that could have a look at the search form, I would obviously pay for it, I have tried to approach a few companies but they will not take on such a small job, they only want to take on the development of the entire database?
Anyone know of anyone?

Jackie :)

View 2 Replies View Related

Finding #

Nov 4, 2005

I'm searching through some text fields like the following:
Ann12 #1
Ann12 #2
Ann12 #3
Ann1 #12
Ann2 #14
ect...
I'm doing a like query
Like "*#*2*"
However, the # is the keyword for Date, so what do I use instead?

View 1 Replies View Related

Finding ABC

Aug 17, 2006

Hi

I hope someone can help with this as I can't seem to get this query to work.

I am trying to use a query to search for the highest value in a column but based upon a specific criteria.

i.e. in the column will be ABC1234, ABC1235, ABC1236 and BBC1234 and I want to get the highes 'ABC' value

I looked on the forum and found this code

Dim strSQL As String
Dim MyValue As DataType 'Replace the proper datatype of field
Dim rs As ADODB.Recordset, Cn As ADODB.Connection
Set rs = New ADODB.Recordset
Set Cn = New ADODB.Connection
Set Cn = CurrentProject.Connection
strSQL = "SELECT tableName.ColumnName FROM tableName ORDER BY tableName.ColumnName DESC"
rs.Open strSQL, Cn, adOpenStatic, adLockReadOnly
MyValue = rs!ColumnName
rs.Close
Set rs = Nothing

I've modified the query to this

strSQL = "SELECT tableName.ColumnName FROM tableName WHERE tableName.ColumnName Like 'ABC*' ORDER BY tableName.ColumnName DESC"

This doesn't bring anything back but I was expecting 'ABC1236'

I'm new to using 'Like' so this could be the problem.

Your help is much appreciated.

View 6 Replies View Related

Finding BAC-5, BAC-8 And BAC-12???

May 3, 2007

Greetings all,
It's been a while since I've had to turn to you for help. I'm usually able to find what I need in searching through previous posts, but no luck this time around.

I am trying to write a query criteria that will return

BAC-5, BAC-8 And BAC-12

I can get the -5 and -8 with:

Like "BAC-[58]"

But I can't figure out how to get the -12...

The actual part numbers are quite a bit longer and there are hundreds where I only need specific dash numbers returned.

I'm sure this one will be simple, I just couldn't seem to figure out how to search for it.

Thanks in advance!

View 3 Replies View Related

Finding Something Thats Not There?

Sep 27, 2007

Hi guys

I have a DB for insurance permits.

tblSubtractors
ID
NAME
ADDRESS
PHONE

tblPolicy
ID
SubbyID
POLICYID
Insurer
PolicyNumber
ExpiryDate

tblPolicyTypes
ID
Name


Most subcontractors will have a policy number for each type of policy in tblPolicy. But is there a way I can run a query to show each subby that doesnt have one of the policies? As an example, the query would show me that ABCcontractors doesnt have Marine Transit insurance. XYZContractors doesnt have Public Liability, etc

I know how to show all the policies that have expired, but I'm looking to identify which ones dont have a policy at all

:confused:

View 7 Replies View Related

Finding ID

Aug 6, 2006

Hello,
I have this code that I use to update a record:

Code:<%Dim idid = session("loginID")Dim rsSaveSet rsSave = Server.CreateObject("ADODB.RecordSet")rsSave.open "log", conn, adOpenDynamic, adLockOptimistic, adCmdTablersSave.find "id=" & idDim Datumlogout, Uurlogout, loggedoutOKrsSave("Datumlogout") = datersSave("Uurlogout") = timersSave ("LoggedoutOK") = ("true")rsSave.updatersSave.closeset rsSave=Nothing%>

Can someone help me please, I would like to have the code changed to:

When the ID not excists, that there is a new record written.
Thanks in advance!

View 1 Replies View Related

Finding An Average

Aug 8, 2007

I have a customer concerns database that contains the dates for when the concerns were reported and tyhe dates for when the concerns were resolved. I am trying to make a query that finds the average of how long it takes for the concerns to be resolved. How can I do this?

View 1 Replies View Related

Finding The Last Row In Worksheet

Feb 29, 2008

Now this is not like me, posing a question, but I thought its about time I codes the app correctly.

My app opens up any given spreadsheet. The first task is to establish the last row used in the spreadsheet. Normally you would loop until there is nothing in a cell in column A, whatever.

However the way the spreadsheets are provided there may be pleanty of blank rows. I have tried using the Edit GoTo Special LastCell and converting it to a macro

But when I run this VB it does not like it for some reason.

I am sure someone out there has come up with a solution by now.

CodeMaster::cool:

View 4 Replies View Related

Finding Current_Date?

Nov 2, 2005

I have a table, with 4 records in it. 2 records have the "date" field for 01/11/2005, and 2 dates are for 02/11/2005.

Is there a way to just query the "current" date? Weather it be in a pop-up box once the query is selected, asking for the date? or is there a restricted word within access2003 that lets you find the current date?

I would essentially like a command button within a form to allow the user hit teh button, and it will automatically find those records within the DB with the current date(set to system clock) and export it to excel(i have this portion, the exporting to excel complete)

Any help would be greatly appreciated.

Connor

View 7 Replies View Related

Finding Max Date

Jul 21, 2006

ok ihopefully i wont make this too complicated to under stand.

i ahev a form which will populate a form from a query. the query is pulling info out a table included int hti sinfo is the date when it was entered. in the criterai of the query i hve added this code
Between [Forms]![Boxes Reviewed]![txtFromDate1] And [Forms]![Boxes Reviewed]![txtToDate1]
whcih means that the date must be between the two differnt dates that must be entered on the form.

the problem is, is that a value can be entered more that once with different dates. i woul dwant the report just to shouw the most recent date. i considered doing a query which requested all max dates from the table and then having a query calling forma query. but i do not know enough on how to get just the most recent date.
so if i wrote a query which held

box num, shelf num, resp_person, and date. what would i have to put int he criteria to only bring back the entery witht he most recent date.

sorry if i have rambled and look forward to your help

View 1 Replies View Related







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