473,465 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to select only 2nd record

ddtpmyra
333 Contributor
I dont have my syntax now but here what I wanted to do...

I have multiple rows under field name DateNote
10/10/2010
10/11/2010
10/12/2010

obviously when i get the minimun date it will give me the earliest which is 10/10/2010. Now what i wanted is after teh get the most earliest I wanted to catch the 2nd date after 10/10/2010 which is 10/11/2010.

Please help
Oct 13 '10 #1
4 1412
gpl
152 New Member
Try getting the minimum date that is larger than the real minimum date
Oct 14 '10 #2
NeoPa
32,556 Recognized Expert Moderator MVP
For a more general solution to the nth record, use the TOP predicate of n, then select the MAX() (or MIN() depending on sort order) of the returned result. IE use the TOP within a subquery.
Oct 14 '10 #3
ck9663
2,878 Recognized Expert Specialist
What do you have so far?

~~ CK
Oct 14 '10 #4
ddtpmyra
333 Contributor
I use outer apply and it works for me thanks for the help!

Expand|Select|Wrap|Line Numbers
  1. OUTER APPLY  
  2.     (SELECT TOP 1  um.modifieddate as FirstRespDate, um.TaskNoteTypeId
  3.      FROM dbo.TaskNote um (NOLOCK) 
  4.              where um.TaskNoteTypeId=2 and um.woid = t.WOID
  5.              and um.modifieddate is not null
  6.              order by um.ModifiedDate) as mbg
Oct 26 '10 #5

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

Similar topics

1
by: HenigePaulaM | last post by:
Hi - I'm relatively new to VBA. I have a form that pops up for the user. It asks for a docket #(which is alphanumeric). When the user clicks the get record command button, it gets several fields...
0
by: DavidB | last post by:
I'll try to explain my situation as clearly as possible, but its a tad convoluted. Primary form in question is the Contract Administration form. Secondary form is a Find Contract form (pop up...
3
by: reverendjb | last post by:
I'm stumped on this one, so here goes.... I have 2 tables project and assignment they are linked by the field proj_id where proj_id is the primary key of project and a foreign key in...
2
by: Shivajirp | last post by:
I have table in which Shift no, Start time. End time. if start time of shift is 6pm and end time of shift is 6 am then I want to select record between start time and end time.I need query to selct...
0
by: theadods | last post by:
hello i have a problem i want to get record from specific row to the end i try this query : SELECT * FROM checkinout WHERE not exists (Select TOP 20 * from checkinout);
5
brightshadow
by: brightshadow | last post by:
I have a super simple Access DB with four tables and one form.. I'm an old hand at Excel VBA but am just starting with Access, so this is likely a totally stupid question, but here goes anyway. In...
1
by: jimatparks | last post by:
Hi, I am new, not brand new, but new to VBA. I am trying to get the double-click to select the record the user d-clicks on and move the single record to a new form. The record appears in a subform...
1
by: rk2008 | last post by:
Hi, I'm using following code to select a record on a form from dropdown list and I'm using MSSQL ODBC linked tables inside MS Access: Private Sub cboFind_AfterUpdate() Dim strCriteria As String...
0
by: TD | last post by:
I have a main form with two subforms (both in datasheet view), neither of which are linked to the main form. The main form is based on a query that uses the bound column of a combobox on the main...
8
by: simonc88 | last post by:
Hi guys hope you can help with this one, I have a list box being fed by a table, the list box has 3 columns with the first being an ID number and displays the records that are saved in the table....
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.