?
Solved

Date comparison

Posted on 2012-09-04
3
Medium Priority
?
401 Views
Last Modified: 2012-09-05
Hi

I need to compare to dates.

I have a LCID problem.

My dates are stored in my SQL 2008 database in the format of YYYY-MM-DD.

If I do a <%date()%> the format is DD-MM-YYYY.

Therefore it's not possible to compare these 2 dates.

How can I compare them?
0
Comment
Question by:jensjakobsen
  • 2
3 Comments
 
LVL 11

Accepted Solution

by:
MajorBigDeal earned 2000 total points
ID: 38366463
http://www.sql-server-helper.com/tips/date-formats.aspx

SELECT CONVERT(VARCHAR(10), GETDATE(), 120) AS [YYYY-MM-DD]

SELECT REPLACE(CONVERT(VARCHAR(10), GETDATE(), 111), '/', '-') AS [YYYY-MM-DD]
0
 
LVL 1

Author Comment

by:jensjakobsen
ID: 38367171
THANK YOU!!!!

:)
0
 
LVL 1

Author Closing Comment

by:jensjakobsen
ID: 38367174
Concise!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question