Queries :: Select Records By Comparing Time Stamps In 1 Field

Jun 26, 2014

I can not solve this problem, my Access knoledge is mediocre.

I have the following table from imported data:

RecNr IPaddres DateandTime
1 178.00.000.01 20-11-2013 21:47:21
2 178.00.000.01 20-11-2013 21:47:59
3 178.00.000.01 20-11-2013 21:48:35
4 178.00.000.01 22-11-2013 20:44:59
5 178.00.000.02 22-12-2013 19:47:59
6 178.00.000.02 22-12-2013 20:47:59
7 178.00.000.03 01-02-2014 12:47:59
8 178.00.000.03 01-02-2014 12:48:30
9 178.00.000.03 01-03-2014 11:47:59
etc

I want to make a query that results in displaying records that have the same IP-address where the difference in the date/time stamp is within 1 minute. When the date/time stamp is > 1 minute the record can be deleted from the table.

View Replies


ADVERTISEMENT

Noob Need Help, Comparing 2 Records From Same Field

Aug 12, 2005

Hello everyone,

I'm quite new to access (used to php mostly) and for usual task it's ok but now I have trouble for a quite simple query I think.

I have to compare the values from 1 field and select only the rows just before the value becomes smaller and also the very last row.

example:
if I have a row with 1, 2, 3, 4, 1, 2, 3, 4, 5, 1
I need to put 4 and 5 in an other table

View 1 Replies View Related

Queries :: Comparing Pairs Of Records In A Query

Aug 9, 2013

I need to identify pairs of records by their ID and date fields, then compare their number values to get a text result.

I have a query that has the following fields

AuthInstanceID, ConsumerID, AuthNumberID, AuthStart, AuthEnd, PSRUnits, BSTUnits.

Sample data is below (PSRChange and BSTChange are fields I want to self populate based on the comparison I'm trying to do)

AuthInstanceID....ConsumerID....AuthNumberID....Au thStart....AuthEnd....PSRUnits....BSTUnits - PSRChange -BSTChange
1374006036.........356679..........20255102....... ....4/22/13.......7/21/13....0.............416~~~~-Loss~~~~~-None
-432536491.........356679...........20255102....... ...1/21/13.......4/21/13....104..........416~~~~-Loss~~~~~-Loss
-124970517.........356679...........20147863....... ...10/23/12.....1/20/13....208..........520~~~~-None~~~~~-Null
504564357...........469432..........20254788...... ....4/22/13.......7/21/13....0.............520~~~~-None~~~~~-None
282523535...........469432..........20254788...... ....1/21/13.......4/21/13....0.............520~~~~-None~~~~~-Gain
356661326...........469432..........20254788...... ....11/20/12......1/20/13....0.............416~~~~-None~~~~~-Null

What I need to do is compare these records in the following fashion:

Identify pairs of records where ConsumerID is the same AND AuthStart dates are successive. Then compare PSRUnits of more recent record (by AuthStart) with the previous record (by AuthStart) and determine the change of PSRUnits between them. If change is positive, "Gain" in field PSRChange, "Loss" for a loss, "None" for no change, and "Null" if there is an error due to no previous record to compare with. Do the same with BSTUnits/BSTChange

I've tried adding the following fields, but this did not work

PrevEnd: (Select Max(AuthEnd) from tblAuthorizations Where AuthEnd < Auths.[AuthStart])
PrevBST: DLookUp("[BSTUnits]","tblAuthorizations","AuthEnd=" & [PrevEnd] And "ConsumerID=" & [ConsumerID])

View 14 Replies View Related

Queries :: Comparing Data From One Field To Several Others

Aug 27, 2013

I have one table A that has a Name field that I would like to find if it matches any of the cases in table B with 2 other fields: Field 1 or Field 2

There is no way of establishing referential integrity because the Name Field can be found in either Field 1 or Field 2.

How would I go about searching so I can pull in the rest of the data that I need with when the Name is matched either with Field 1 or 2?

View 2 Replies View Related

Queries :: Comparing Two Values From Rows In Same Field

Jul 10, 2013

I have a table [VL] with four fields, [vl_id], [product], [vl_date], [valeur_liquidative].

The idea of the table is that you can input and update the value of each product on a given day.

I need to find the difference in days between successive dates (vl_date) each time that a product value (valeur_liquidative) is updated. Values aren't updated everyday as it is not updated during the weekends. I have had a go at this but have struggled..

A picture of what the table looks like is attached for reference.

View 9 Replies View Related

Comparing A Date/Time Field To System Date

Dec 11, 2006

Hi,

I am trying to compare a value in my databse produced by the date() function, short date format, to one that is exactly 24 hours after the value recorded by the date() function. If the value in the database is 24 hours prior to the current date(), I need to flag a text box a diffrent color to alert the user. I am unsure on the If statement that I will need to produce this result.

Any help would be greatly appreciated!!!!
Thanks
Mikeco555

View 3 Replies View Related

Queries :: Comparing A Text Field In A Table To Textbox On A Form

Jul 8, 2013

I have a table that has a date field set to text. I use the Mid function and get just the month in a query. I have a textbox on a form that when the user adds a month or removes a month from a selected listbox it adds or removes that months number from the textbox.

I want to us that text box on the form as the criteria for the month (the Mid function getting the month) and I can seem to get it to read what's in the textbox and use it as the criteria. I can manually type in a number and it works fine.

View 6 Replies View Related

Select And Append Queries... At The Same Time?

Oct 10, 2007

I've done some searching, and haven't found any threads that match what I am attempting...

I have a database that tracks expenses that are incurred under different ongoing projects. I currently have a report based on a query that asks the user for the project number, and shows all the expense invoices that have not been paid for that project. This report is basically an internal invoice that gets assigned to a department, and so it is assigned an internal "invoice" number. Currently, the user types in this internal number before the report is generated and it is displayed on the report for printing purposes.

Here's the tricky part (for me anyways): I would like to be able to filter the invoice records by project number, and then append the user-entered internal invoice number to the applicable records. There is already a field in the table for this data, and it is currently being entered on individual records after the report is printed. My goal is to be able to do this all in one step.

Any help will be greatly appreciated... Thanks guys!

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

Comparing Current Time

Apr 13, 2007

I have a table with a list of events and times at which they occur. I would like to compare these times with the current system time, and display perhaps the next 10 events chronologically. Does anyone know how to do this?

Thanks

View 1 Replies View Related

Comparing Data On Record At A Time

May 3, 2006

Hi - I'm working on a query, and can't seem to get it to work correctly. I have a table which contains 2 social security number fields - one for a dependent/employee with benefits, and one for the originally insured (for example, if an employee passed away, the dependent would be on the file, and the originally insured data would be populated with the original employees data). There are also cases where the employee and dependent exist in the table at the same time. I need to check the table, record by record, to identify any cases where the two SSN's are the same in any given record. The query is currently finding an employee's SSN on their record, and also finding it in the originally insured field of the dependent's record and showing it as an error. I only need to know if they occur for the same record, not for another record in the table. (I hope this makes sense!!!)

Is there any way that I can do this??? Any help would be greatly appreciated!!!!

View 4 Replies View Related

Date Stamps - I'm A Novice!

Oct 14, 2004

could anyone advise how to get a date written to a field when a check box is changed to "yes"? i'm useless at VB!

thanks.

View 2 Replies View Related

Queries :: SELECT TOP 3 Returning More Records

Mar 24, 2015

My statement below is current returning 4 records. Two of the records have the same GBPAmount value.

RequestID is the Primary Key

Code:
SELECT TOP 3 RequestID, GBPAmount, Currency, RequestDate
FROM PayRequest
WHERE (((Currency)="CAD Canadian Dollar") AND ((RequestDate)>#11/16/2014#))
ORDER BY GBPAmount;

Code:
RequestID GBPAmount Currency RequestDate
10207 8.17 CAD Canadian Dollar 03/02/2015
9874 33.82 CAD Canadian Dollar 20/01/2015
11327 109.58 CAD Canadian Dollar 23/02/2015
10495 109.58 CAD Canadian Dollar 05/02/2015

View 3 Replies View Related

Queries :: Get A Query To Select All Records?

May 3, 2014

I'm having a problem get a query to select all of the records it should be.

When I filter the source table (200_STANDARDIZED NRGL) to show the data I want to see (PC2 = 6000; GAAP = 02; CGL = 0950, 2735, 2736, 3500 and 3501; STD VENDOR NAME = blanks), I get 33 records.

NOTE: Had to take the PC2 records that were not '6000' out of the dB I've attached in order to be able to send dB bu the PC2 filter is needed in the complete dB.

When I create a select query to the do the same thing, I get either:3 records (when I set STD VEND NAME to Like '') or 30 records (when I set STD VEND NAME to NOT Like '*' ) I've attached the dB - Query 1 is the subject of bullet 1 above and Query 2 is the subject of bullet 2 above.

BTW, the three records that show up in Query 1 are the same records missing from Query 2.

View 3 Replies View Related

Queries :: Select Records With Minimum Value

Mar 12, 2015

I would like to select records based on Minimum values of specific vendor.

Example:

MasterItemID Price PriceDate VendorID
1 2 2/5/14 30
1 3 2/5/14 31
1 7 2/5/14 32
2 3 2/5/14 31
2 2 2/5/14 32

So wants the all columns where price is minimum

Example: output required

MasterItemID Price PriceDate VendorID
1 2 2/5/14 30
2 2 2/5/14 32

View 6 Replies View Related

Queries :: How To Select Records When Date Is Less Than 30 Days Apart

Mar 10, 2014

I have a large database filled with customer records. Some customers come one time. Other customers come 50 times at year. I want to find all customers that have records that are less than 30 days apart so I can ultimately see the types of products they buy. How do I write the query?

I attached a picture of a sample database. The 30 day (+/-) field doesn't exist but I would like the query results to build it.

View 11 Replies View Related

Queries :: Get Average Of Select Group Of Records?

Sep 26, 2013

I am trying to get the average of a select group of records within a query. It appears the davg function should give me what I need, however my query returns no results. Here is a sample of my data.

Item Cost Basis Group Cost
1HF20812 1HF208 6.17
1HF20816 1HF208 8.63
1HF20820 1HF208 9.44

Here is the davg string I am trying to use.

Group: davg("Cost","Cost Basis Group")

View 2 Replies View Related

Queries :: Update Query On Select Records

Apr 4, 2013

I have a Sales Table with below fields, i might have not set it up in the best way possible.

Consumer, Consumer_ID, SaleDate,Prod_Sl#,Prod_Type,Sale Amount

1. I need to update the sales price for each item sold based on category of Product Type, as we are tracking the product with Serial Number.

For an instance if 2 items of Category1 with Prod_Sl# as Sl1 and Sl2 and
2 items of Category 2 with Prod_Sl# as Sl3 and Sl4 are sold.

I need to update the sales price amount for these.

2. I want to accomplish this using a query.

View 1 Replies View Related

Queries :: Select Query Losing Records?

Sep 19, 2013

I have a Union query as follows;

SELECT ALL *
FROM 1st_Lives
UNION SELECT ALL *
FROM 2nd_Lives;

1st Lives has 465,414 records and 2nd Lives has 151,852 records.

When I run the query I only get 604,976 records instead of 617,266 (I basically just want to add the two data items together).

View 1 Replies View Related

Queries :: Select Query Multiplies Records?

Feb 5, 2014

I'm having a bit of a situation with a select query that I set up.

I have two tables, both with a list of serial ID's.

One is table field is formatted like this:

"B0340 13 453423 X"
The other is formatted like this:
"=B03401345342300"

I wanted a select query that could show me the records in a universal serial like this:

"034013453423"

This leaves out the "spaces", the "B" and the " X". (Couldn't find a way to make Access generate a new field with the serial ID correctly without a query).

So I used the "Mid" expression in a select query and it worked, it showed me the first table in the correct format.I wrote the same "Mid" expression for the other table and it worked too.But, when I ask for the results for both tables in the same query, it shows me much more records than I have(all duplicates). I figured out that when in table one I have 20 records, in table two I have 5 then the query shows 120 results (20 x 5).

This is the code in SQL view:

Code:
SELECT MainDatabase.[Transfusie Eenheid + Specification], (Mid([MainDatabase].[Transfusie Eenheid + Specification], 2, 4) & [MainDatabase].[Transfusie Eenheid + Specification], 7, 2) & [MainDatabase].[Transfusie Eenheid + Specification], 10, 6)) AS [BloedeenheidID MD], ScannedForms.BloedEenheidID, Mid[ScannedForms].[BloedeenheidID], 3, 12) AS [BloedEenheidID SF]
FROM MainDatabase, ScannedForms;

View 4 Replies View Related

Select Records To Insert Into A Field From Pop Up Form

Jul 4, 2005

Hi all,

I have a table which contains business details (name, address etc) and also a field for clients. I then have a table which contains client details. Is there anyway I can click a button on a form containing business details which brings up a form containing the clients which would allow me to click the clients I want to be inserted onto the clients field on the business details table?

Does anybody have an example of this.

Thanks for your help!

View 1 Replies View Related

Need To Select Records With Empty Currency Field

Jan 16, 2006

I've tried the following WHERE clause to return records where the 'costper' field is empty and neither return any results.

WHERE NZ([Transactions].[CostPer])=0

WHERE [Transactions].[CostPer]=0

WHERE IsNull([Transactions].[CostPer])

View 2 Replies View Related

How To Select Records Based On Summation Of Another Field

Jan 14, 2007

Hello,

I have a dataset that consists of Stands within a forest inventory. There are two Fields: the first field is StandValue (dollars), the other field is the StandArea( hectares).

I want to select the highest valued stands BUT the sum of the individual areas found in "standArea" cant exceed 10,000 hectares. Can anyone help me figure out an SQL query for this, or any other suggestions on how to proceed would be greatly appreciated, thanks
Greg

View 2 Replies View Related

Counting Records In Report From Select Field

Aug 22, 2015

there are 3 options Yes Somewhat and Not really I want to count the records that only have Yes.

View 5 Replies View Related

Queries :: Select Random Records From Unrelated Tables

Aug 9, 2014

I am fairly new to Access 2013 but am trying to create a query that will select random records from three totally unrelated tables and display the results together as if one table -- think video slot machine wheels. Each table has two fields - ID which is the primary key and NAME. The data in the tables are names of states, names of colors, and types of animals. Each table has a different number of records. My end result is a table that selects X number of random records from each table and displays them side by side like this:

Desired Result:
Animal Color State
cat red Ohio
dog blue Texas
fox green Iowa

I have been able to create three individual queries that will pull X number of random records by using:

SELECT TOP 10 Animals.[ID], Animals.[Name] FROM Animals ORDER BY Rnd(-(100000*[ID])*Time());
SELECT TOP 10 Colors.[ID], Colors.[Name] FROM Colors ORDER BY Rnd(-(100000*[ID])*Time());
SELECT TOP 10 States.[ID], States.[LongName] FROM States ORDER BY Rnd(-(100000*[ID])*Time());

Using the three queries above I get three separate lists. how to make one query that will randomly pull from all three tables and make the display above?

View 14 Replies View Related

Queries :: Use A Query To Select Specific Records From Table

Dec 14, 2013

While I am not new to Access, I am not well versed in its abilities as far as combo boxes go. What I have is a Form where a combo box allows you to pick from a table records 'record ID #' in order to fill in the data of that record to the rest of the form.What I want to do is use a query to select specific records from this table and allow the combo box to show only these 'selected Record IDs' for user selection.

View 1 Replies View Related







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