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

What is the syntax for finding the Month(number) in DB2?

I want to compare the date today (getdate() in T-SQL) to a date in a column and subtract whole months to age a record.
Example, if the last transaction date was 9/1/2008, I want to be able to say
IF LAST_TRAN_DATE >= GETDATE() -1 THEN <DoSomething> ELSE <DontDoSomething>

In this case, I would expect <DontDoSomething> because September is less than November minus 1 (October).

How would I say this in a DB2 query?
Nov 3 '08 #1
1 2149
Expand|Select|Wrap|Line Numbers
  1. if Last_tran_date >= Current Date - 1 Month
Nov 20 '08 #2

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

Similar topics

2
by: rollasoc | last post by:
Hi, I've worked out how to find the 2 COM Ports on my motherboard ok, using System.Management namespace and looking for Win32_SerialPort. Problem now, is I have 3 COM Ports on USB connections,...
4
by: Andrés Guerrero | last post by:
Hi, I'm working with Ms Access 97 and I have two tables like these: Table: Person Table: Phone Field: ID (Autonumeric) (primary key) Field: Person_ID (foering key)...
3
by: rollasoc | last post by:
Hi, Anyone know a way of working out the total number and which COM ports exist on a machine, using C#? rollasoc
0
by: rollasoc | last post by:
Hi, Ok, sussed how to find the 2 COM Ports on my motherboard ok, using System.Management namespace and looking for Win32_SerialPort. Problem now, is I have 3 COM Ports on USB connections, but...
3
by: Aussie Rules | last post by:
Hi, How do I extract just the month part of a date. Say for example I wanted to get the value of 6 (as in sixth month) from todays date. Regards
11
by: John | last post by:
Is there a way to find the number of processors on a machine (on linux/ windows/macos/cygwin) using python code (using the same code/cross platform code)?
25
by: Daniel Kraft | last post by:
Hi, I do need to implement something similar to C++'s std::bitset in C; for this, I use an array of int's to get together any desired number of bits, possibly larger than 32/64 or anything like...
3
by: Akash | last post by:
Hi, I am using getProcessTimes API for calculating CPU Usage On a Multi-Core processor i have observed that the %CPU Usage that is multiple of the number of cores of the processor Is there any...
1
by: bharathreddy | last post by:
This article will explain how we can get the count of weekdays in between two dates. This will be usefull if we want to count the number of working days between two dates. Example: -------------...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.