sqlite: calculating with dates - compare current date minus 6 months with stored record


 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications sqlite: calculating with dates - compare current date minus 6 months with stored record
# 1  
Old 03-10-2011
sqlite: calculating with dates - compare current date minus 6 months with stored record

Hi

I have a table with name, date in format DD.MM.YYYY.

Quote:
name expiry date
example CA 04.05.2013
example Sub-CA 01.09.2012
I need to something like this (I try to explain in pseudo code)

Code:
if SYSDATE (current date) minus 6 months > $expiry date
print OK
else print NOK with $name and $expiry date

I know this is possible with Oracle. How to do this in sqlite?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

How to minus 2 month from current date?

I am running a script in ksh to get the 2 months back date from system date.The below code is giving correct date output from putty command prompt.But while running the script is .ksh file it is giving the error below.Please suggest. ; d=a; y=a m-=num while(m < 1) {m+=12; y--}... (1 Reply)
Discussion started by: hini
1 Replies

2. HP-UX

Actual date minus six months (HP UX)

Hi there, is it possible to get the actual date minux six months with just a simple command? It's easy with Linux but on HP Unix (for me) impossible ;) Best wishes (3 Replies)
Discussion started by: System
3 Replies

3. Shell Programming and Scripting

Comparing the dates with the current date in perl scripting

Hi i have a file containg dates likebelow 4/30/2013 3/31/2013 4/30/2013 4/16/2013 4/30/2013 4/30/2013 5/30/2013 5/30/2013 4/30/2013 5/30/2013 5/30/2013 3/31/2013 now i want to compare the above dates with current date and i want to display the difference . (10 Replies)
Discussion started by: siva kumar
10 Replies

4. Shell Programming and Scripting

How to compare current record,with next and previous record in awk without using array?

Hi! all can any one tell me how to compare current record of column with next and previous record in awk without using array my case is like this input.txt 0 32 1 26 2 27 3 34 4 26 5 25 6 24 9 23 0 32 1 28 2 15 3 26 4 24 (7 Replies)
Discussion started by: Dona Clara
7 Replies

5. Shell Programming and Scripting

current date - 8 months in perl script

I have a requirement as follows. when i pass a date to the perl script, it has to calculate the current date - 8 months and output the date back to the shell script in date format (YYYY-MM-DD). Current date - 8 months is not constant.. because leap year, and the months jan, mar, may,.... has... (4 Replies)
Discussion started by: kmanivan82
4 Replies

6. Shell Programming and Scripting

ksh compare dates INSIDE a file (ie date A is > date B)

In KSH, I am pasting 2 almost identical files together and each one has a date and time on each line. I need to determine if the first instance of the date/time is greater than the 2nd instance of the date/time. If the first instance is greater, I just need to echo that line. I thought I would... (4 Replies)
Discussion started by: right_coaster
4 Replies

7. UNIX for Dummies Questions & Answers

print previous month (current month minus 1) with Solaris date and ksh

Hi folks month=`date +%m`gives current month Howto print previous month (current month minus 1) with Solaris date and ksh (7 Replies)
Discussion started by: slashdotweenie
7 Replies

8. Shell Programming and Scripting

change date format and then compare dates

I have filenames filenameA_fg_MMDDYY.tar.gz filenameASPQ_fg_MMDDYY.tar.gz filenameAFTOPHYYINGH_fg_MMDDYY.tar.gz filenameAGHYSW_fg_MMDDYY.tar.gz My requiremnt needs to extract date which is in MMDDYYand change it into YYYYMMDD format. I have done the following: filedate=`echo... (5 Replies)
Discussion started by: RubinPat
5 Replies

9. UNIX for Dummies Questions & Answers

print all dates 100 days from current date

can anyone please suggest me on ideas to write a script which has to go back to 100 days from 'current date' and print the date of each day starting from 100th day to current day. (korn shell please) Thanks Pavan (5 Replies)
Discussion started by: pavan_test
5 Replies

10. Shell Programming and Scripting

Compare dates in a field and print the latest date row

Hi, I need a shell script which should find the latest date in the field of file and print that line only. For eg., I have a file /date.log Name Date Status IBM 06/06/07 close DELL 07/27/07 open DELL 06/07/07 open : : : From... (1 Reply)
Discussion started by: cvkishore
1 Replies
Login or Register to Ask a Question
DATETIME.MODIFY(3)							 1							DATETIME.MODIFY(3)

DateTime::modify - Alters the timestamp

       Object oriented style

SYNOPSIS
public DateTime DateTime::modify (string $modify) DESCRIPTION
Procedural style DateTime date_modify (DateTime $object, string $modify) Alter the timestamp of a DateTime object by incrementing or decrementing in a format accepted by strtotime(3). PARAMETERS
o $object -Procedural style only: A DateTime object returned by date_create(3). The function modifies this object. o $modify -A date/time string. Valid formats are explained in Date and Time Formats. RETURN VALUES
Returns the DateTime object for method chaining or FALSE on failure. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.6 | | | | | | | Absolute date/time statements now take effect. | | | Previously, only relative parts were used. | | | | | 5.3.0 | | | | | | | Changed the return value on success from NULL to | | | DateTime. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 DateTime.modify(3) example Object oriented style <?php $date = new DateTime('2006-12-12'); $date->modify('+1 day'); echo $date->format('Y-m-d'); ?> Procedural style <?php $date = date_create('2006-12-12'); date_modify($date, '+1 day'); echo date_format($date, 'Y-m-d'); ?> The above examples will output: 2006-12-13 Example #2 Beware when adding or subtracting months <?php $date = new DateTime('2000-12-31'); $date->modify('+1 month'); echo $date->format('Y-m-d') . " "; $date->modify('+1 month'); echo $date->format('Y-m-d') . " "; ?> The above example will output: 2001-01-31 2001-03-03 SEE ALSO
strtotime(3), DateTime.add(3), DateTime.sub(3), DateTime.setDate(3), DateTime.setISODate(3), DateTime.setTime(3), DateTime.setTimes- tamp(3). PHP Documentation Group DATETIME.MODIFY(3)