473,386 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to Identify Subsequent Dates from a first Date?

Good Morning,

I am struggling with something I am sure should be easy but I just can't find a good way to deal with it. I have a table which lists appointments.

There is a CaseID, An Appointment Date and an Appointment ID (Other fields as well but these are the identifyers.) what I need to do is to run a report showing how many subsequent visits have been made. (A subsequent visit is any visit other than the first by CaseID)

So far I have "SELECT CaseID, Min(Appointment Date]) FROM tbl_Appointments" this brings up the first appointment for each case, the problem is I want to also bring up the Appointment Number (So that in the next query I can use "Not IN (Select ApptNbr FROM qry_FirstAppt)" as the criteria for my second visits query but if I add the Appointment Number it groups by it and therefore returns each record.

I am sure there must be an easier way but at the moment I just can't get my head around it. Sorry if this is quite garbled but I have been trying what I thought would be a 10 minute query for two days now and it is hurting my head.
Nov 22 '10 #1
1 1595
I have found the answer now thanks to this reply on another board (Typical I find it half an hour after I gave up looking!)

http://www.tek-tips.com/viewthread.c...1591896&page=1

Turns out the Answer is all to do with sub queries.

Thanks for looking at my question anyway.
Nov 22 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Colin Steadman | last post by:
I'm a stupid ASP programmer and I dont do Javascript (except for very simple tasks anyway), and I'm in a bit of a predicament. I've used a javascript table sorting script from here: ...
6
by: christopher.secord | last post by:
I have a table containing typed log entries. One log entry is supposed to be created every twelve hours, but sometimes there are gaps. I need to create a report showing the time of entry, and the...
3
by: tilak.negi | last post by:
Hello ! I'm trying to update one table field with another table searched first date record. getting some problem. If anyone have experience similar thing or have any idea about it, please guide....
5
by: deko | last post by:
After importing text date fields, the dates look like this: 12/31/2003 8:00:00 AM I'm having trouble working with these dates with Date(), Now(), etc, -- does not seem to match these dates....
0
by: Alicia | last post by:
Hello, I need some help with First Criteria statement or DISTINCT. I would like the Par # column to have all distinct or just the first value it encounters. I tried to add the criteria in access,...
3
by: Ray | last post by:
I need to find the first date of ship_date from table B for in my query of table A. The common field is model. Table A Fields: Model, dev_date, tool_off_date Table B Fields: Model,...
12
by: colincolehour | last post by:
I am new to Python and am working on my first program. I am trying to compare a date I found on a website to todays date. The problem I have is the website only shows 3 letter month name and the...
44
by: user | last post by:
Hi, Let's say I have 2 dates in the b/m format: Date 1 and date 2 How do I check whether Date2 is later than Date 1? Date1. 21-Nov-2006 09:00:00 PM
1
by: cjordan | last post by:
Hi everyone. I'm new here, and I think I've got a pretty unique problem (haven't found any solution to this anywhere else), but I'm hoping that someone here can help me. To be honest, I'm not a...
1
by: disney86 | last post by:
I am setting up Forms in Access 08. I have a form which when opened will auto insert the current time and current date. I need to be able to allow the user to set up paramaters to auto select a...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.