How to get the missing date and day in a table?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to get the missing date and day in a table?
# 1  
Old 02-27-2013
How to get the missing date and day in a table?

Hi Am using unix Aix Ksh
Have Created table called vv
and i have inserted two date

Code:
Select * from vv;
 
Output :-
 
New_date
21/02/2013
24/02/2013

I have tried Using One query but Unsuccessful so far..

Code:
 
SELECT l.new_date + '1 day' as miss
from vv as l
left outer join vv as r
on l.new_date + '1 day' = r.new_date
where r.new_date is null

When i tried running the above query am getting the output as
Code:
miss
 
22/02/2013
25/02/2013

i need the results as
Code:
miss
22/02/2013 , fri
23/02/2013.  sat
24/02/2013 , sun
 
 
or atleast
fri
sat
sun


Can anyone help me pls ....
# 2  
Old 02-27-2013
Did you even try my suggestion posted in your previous thread
# 3  
Old 02-27-2013
bipinajith ,

The to_char and to_date function was not working in unix Aix Ksh version 5.
# 4  
Old 02-27-2013
Quote:
Originally Posted by Venkatesh1
bipinajith ,
The to_char and to_date function was not working in unix Aix Ksh version 5.
Forget about AIX & KSH. Tell us which database are you using?
# 5  
Old 02-27-2013
Hi bipinajith ,
Am using isql DB on unix Server...
# 6  
Old 02-27-2013
AFAIK isql is just an interface or utility used to connect to a DB & execute queries and to_char and to_date are standard SQL functions.
# 7  
Old 02-28-2013
bipinajith ,

Using Ingres DB..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Replace date in file every day with current date

I Have text like XXX_20190908.csv.gz need to replace Only date in this format with current date every day Thanks! (1 Reply)
Discussion started by: yamasani1991
1 Replies

2. Shell Programming and Scripting

Fill in missing rows with zero to have uniform table

Hello, I have two files of same structure except some rows are missing randomly in each file. How do I fill the missing rows to have the exact ID column (S01 ~ S96) and rest columns filled with "0" with awk? The purpose of this step is to join the two files side by side. The closest thread is... (17 Replies)
Discussion started by: yifangt
17 Replies

3. AIX

Need to get the next day's date of the user entered date

I need to get the next day's date of the user entered date for example: Enter date (yyyy/mm/yy): 2013/10/08I need to get the next day's date of the user entered date Desired Output: 2013/10/09Though there are ways to achieve this is Linux or Unix environment (date command) ,I need to... (1 Reply)
Discussion started by: rpm120
1 Replies

4. Shell Programming and Scripting

Missing date

hi team, i have a file contains data as follows F1 file --------------------------- date system name 1-jan-2012 x 1-jan-2012 y 1-jan-2012 x 5-jan-2012 y 3-jan-2012 z 3-jan-2012 z 4-jan-2012 x 4-jan-2012 x ... (13 Replies)
Discussion started by: rabindratech
13 Replies

5. Shell Programming and Scripting

finding the previous day date and creating a file with date

Hi guys, I had a scenario... 1. I had to get the previous days date in yyyymmdd format 2. i had to create a file with Date inthe format yyyymmdd.txt format both are different thanks guys in advance.. (4 Replies)
Discussion started by: apple2685
4 Replies

6. UNIX for Dummies Questions & Answers

Getting date -1 day not using GNU date

It's easy as pie to get the date minus one day on opensolaris: date -d "-1 day" +"%Y%m%d"run this command on our crappy Solaris 10 machines however (which I'm guessing doesn't have GNU date running on it) and you get: date: illegal option -- d date: illegal option -- 1 date: illegal option --... (5 Replies)
Discussion started by: rich@ardz
5 Replies

7. Shell Programming and Scripting

how to obtain date and day of the week from `date` command

Hi, does anybody know how to format `date` command correctly to return the day of the week? Thanks -A I work in ksh.... (1 Reply)
Discussion started by: aoussenko
1 Replies

8. Shell Programming and Scripting

Compare date from db2 table to yesterday's Unix system date

I am currently running the following Korn shell script which works fine: #!/usr/bin/ksh count=`db2 -x "select count(*) from schema.tablename"` echo "count" I would like to add a "where" clause to the 2nd line that would allow me to get a record count of all the records from schema.tablename... (9 Replies)
Discussion started by: sasaliasim
9 Replies

9. UNIX for Dummies Questions & Answers

date - 1 day

Hi, I have been trying just about every unix command to come up with yesterday's date (today's date - 1). I have seen all of the help on this forum, and none of it seems to work for me here. We are using Sun Solaris 9 Unix. I am using this script to create a .txt file with ftp commands that I will... (2 Replies)
Discussion started by: sfedak
2 Replies

10. Shell Programming and Scripting

Getting day from a date...

Hi, I have a date input in MMDDYYYY format.. I have to give the day (whether that DD is sunday/monday...) Is there any command for it... Or do I have to write a script for that... Thanks in Advance Yeheya (1 Reply)
Discussion started by: yeheyaansari
1 Replies
Login or Register to Ask a Question