473,385 Members | 1,757 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,385 software developers and data experts.

Compare Two Dates on 30 days greater than the other

Trying to write a sql statement to return a result set comparing two dates where the 1st date is 31 days or greater than the 2nd date
Jul 31 '15 #1
1 2269
Luuk
1,047 Expert 1GB
Maybe this will help:
Expand|Select|Wrap|Line Numbers
  1. SELECT
  2.    DATE('2015-08-01'),
  3.    ADDDATE(DATE('2015-08-01'), INTERVAL -1 DAY),
  4.    DATEDIFF('2015-08-01','2015-01-01');
  5.  
This should return 3 column with the values:
2015-08-01; 2015-07-31; 212

(my date-format is 'YYYY-MM-DD')
Aug 1 '15 #2

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

Similar topics

4
by: alexis | last post by:
Hi, In a form I have the curent date <input name="datetoday" type="hidden" value="<? echo date("d/m/Y"); ?>"> and <input type=text name="datebox" size=15> The date format is d/m/Y...
9
by: Rich | last post by:
Thanks for the Help in my previous post. I've been working on this and it's almost what I want. I want to obtain the user's current age by comparing their date of birth (user inputs) to the...
1
by: Manny Chohan | last post by:
i have two date fields for event start date and end date. I let the user enter two on create event page. on submit, i need to compare if the end date is earlier than start date or not. How can i...
5
by: Tom | last post by:
It appears that you can't compare two dates in DotNet. You must use ToString and compare the strings. Is that the only reliable way? Try this: Dim dteOne As Date =...
1
by: jackiepajo | last post by:
Please help me, i want to compare dates between two check boxes like i want to compare inputs check in date and check out date to those stored in the database. please help....
4
by: xiaowei | last post by:
I m writing some VB codes for my access database... Now I have a table which contains a "editDate" field, its format is "26/06/2007 11:12:34 AM", then I created a form which would ask the user to...
5
by: maralfarshadi | last post by:
Hi everybody The date values entered in my text boxes (startDate and endDate) in my form are in ISO format YYYY-MM-DD. Could you please help me and explain how I can compare the date values to...
2
by: ghjk | last post by:
How can i compare two days in php and my sql? In my web application user should register a date and the validity period(ex.5 days). I want to count days and cancel the user operations after that...
2
by: site | last post by:
Have to compare dates of two rows in one table Input table COL1| COL2| COL3| COL4 1| A| 1-Jan-07| 6-Feb-08 2| A| 7-Feb-08| 31-Mar-08 3| A| 1-Jan-09| NULL SQL code to compare COL 4 date (Row...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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.