15,898,689 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Shadow373 (Top 5 by date)
Shadow373
25-Jan-12 2:03am
View
Man, I really know about DATEADD. Your shot miss the target. See my comment to message from Markus.
Btw, DATEADD don't help if there are some holes between dates like this:
01.01.2012
03.01.2012
04.01.2012
21.02.2012
etc.
Shadow373
25-Jan-12 1:58am
View
Hi, Amir. I don't think that my instructor wants to make me fail. He say that he take this test from real working database. And ha also say that it was a simple select with conditions.
Shadow373
25-Jan-12 1:53am
View
That's was a direct order. :(
Shadow373
25-Jan-12 1:50am
View
Marcus, I know how to make this query using subquery. It's simple:
SELECT T.f, (SELECT MIN(t1.f) FROM T t1 WHERE T.F < t1.f) AS MinF
FROM T
ORDER BY T.f ASC
-- Here are results:
f MinF
----------------------- -----------------------
2012-01-01 00:00:00.000 2012-01-02 00:00:00.000
2012-01-02 00:00:00.000 2012-01-03 00:00:00.000
2012-01-03 00:00:00.000 2012-01-04 00:00:00.000
2012-01-04 00:00:00.000 2012-01-05 00:00:00.000
2012-01-05 00:00:00.000 2012-01-06 00:00:00.000
2012-01-06 00:00:00.000 2012-01-07 00:00:00.000
2012-01-07 00:00:00.000 2012-01-08 00:00:00.000
2012-01-08 00:00:00.000 2012-01-09 00:00:00.000
2012-01-09 00:00:00.000 2012-01-10 00:00:00.000
2012-01-10 00:00:00.000 NULL
but i need remove this part
(SELECT MIN(t1.f) FROM T t1 WHERE T.F < t1.f) AS MinF
and make query without it.
I think about it but can't find solution. That's why I ask community help.
Shadow373
31-Dec-11 13:31pm
View
Thank you! Your explanation really help me not only with comboboxes.