The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
compare files in the system with last modified date bsandeep_80 Linux 6 01-15-2008 12:56 AM
How can i get the yesterday's date in YYYYMMDD format prasadsr HP-UX 4 01-19-2007 09:52 AM
get yesterday's date? fedora Shell Programming and Scripting 1 12-08-2006 03:28 PM
Yesterday's date function ssmiths001 UNIX for Dummies Questions & Answers 4 01-11-2005 10:06 AM
Yesterday's date ssmiths001 UNIX for Dummies Questions & Answers 2 11-22-2004 09:46 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 04-23-2008
sasaliasim sasaliasim is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 22
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 where PROCESS_DT(a datetime variable in tablename which is formatted as DATE9.) is equal to the today's unix system date - 1. I'm not sure of the proper syntax. Please help.

count=`db2 -x "select count(*) from schema.tablename where PROCESS_DT=UNIX system date-1"`
 

Bookmarks

Tags
shell script, shell scripting, unix scripting, unix scripting basics

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:14 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0