Click here to Skip to main content
15,890,579 members
Home / Discussions / Database
   

Database

 
AnswerRe: Pls Help - Visual C++ with ADO [modified] Pin
George L. Jackson30-May-06 11:29
George L. Jackson30-May-06 11:29 
QuestionADO Books Pin
Rajkamal_dfine30-May-06 4:23
Rajkamal_dfine30-May-06 4:23 
QuestionConnection error Pin
Paps230-May-06 3:22
Paps230-May-06 3:22 
AnswerRe: Connection error Pin
Jerry Hammond30-May-06 7:18
Jerry Hammond30-May-06 7:18 
QuestionTrap difference between two records... Pin
deep730-May-06 2:31
deep730-May-06 2:31 
AnswerRe: Trap difference between two records... Pin
Colin Angus Mackay30-May-06 2:47
Colin Angus Mackay30-May-06 2:47 
GeneralRe: Trap difference between two records... Pin
deep730-May-06 18:15
deep730-May-06 18:15 
GeneralRe: Trap difference between two records... Pin
r.stropek4-Jun-06 6:35
r.stropek4-Jun-06 6:35 
Hi!

This query shows how to do that:
<br />
select	e1.EmployeeID, e1.BirthDate, <br />
		cast(e1.BirthDate-(<br />
			select	top 1 e2.BirthDate<br />
			from	HumanResources.Employee e2<br />
			where	e2.BirthDate<e1.BirthDate<br />
			order by e2.BirthDate desc<br />
		) as float)<br />
from	HumanResources.Employee e1<br />
order by e1.BirthDate desc<br />

You can try it with SQL Server's AdventureWorks sample DB.

Rainer Stropek
Visit my blog at http://www.cubido.at/Blog/tabid/176/BlogID/4/Default.aspx
QuestionHow to convert the Sql tables to stored procedure Pin
a_n_sowmya30-May-06 0:31
a_n_sowmya30-May-06 0:31 
AnswerRe: How to convert the Sql tables to stored procedure Pin
Colin Angus Mackay30-May-06 2:12
Colin Angus Mackay30-May-06 2:12 
AnswerRe: How to convert the Sql tables to stored procedure Pin
sathish s31-May-06 2:06
sathish s31-May-06 2:06 
GeneralRe: How to convert the Sql tables to stored procedure Pin
a_n_sowmya31-May-06 5:46
a_n_sowmya31-May-06 5:46 
GeneralRe: How to convert the Sql tables to stored procedure Pin
sathish s31-May-06 19:02
sathish s31-May-06 19:02 
GeneralRe: How to convert the Sql tables to stored procedure Pin
a_n_sowmya31-May-06 19:31
a_n_sowmya31-May-06 19:31 
Questionhow to apply where condition on date field in msaccess Pin
GANsJob29-May-06 22:02
GANsJob29-May-06 22:02 
AnswerRe: how to apply where condition on date field in msaccess Pin
Michael Potter30-May-06 8:46
Michael Potter30-May-06 8:46 
GeneralRe: how to apply where condition on date field in msaccess Pin
GANsJob1-Jun-06 3:55
GANsJob1-Jun-06 3:55 
QuestionJust Time in DateTime Field Pin
Ali Beirami29-May-06 9:00
Ali Beirami29-May-06 9:00 
AnswerRe: Just Time in DateTime Field Pin
Michael Potter30-May-06 8:48
Michael Potter30-May-06 8:48 
QuestionRe: Just Time in DateTime Field Pin
Ali Beirami30-May-06 12:51
Ali Beirami30-May-06 12:51 
AnswerRe: Just Time in DateTime Field Pin
Michael Potter31-May-06 3:07
Michael Potter31-May-06 3:07 
QuestionSELECT QUERY Pin
NICE TO MEET29-May-06 0:31
NICE TO MEET29-May-06 0:31 
AnswerRe: SELECT QUERY Pin
Colin Angus Mackay29-May-06 4:59
Colin Angus Mackay29-May-06 4:59 
AnswerRe: SELECT QUERY WITH CODE Pin
Colin Angus Mackay30-May-06 2:21
Colin Angus Mackay30-May-06 2:21 
AnswerRe: SELECT QUERY Pin
Colin Angus Mackay31-May-06 2:22
Colin Angus Mackay31-May-06 2:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.