troubleshooting Question

How to get the DB2 Current date in Where Clause for VB Program.

Avatar of Hojoformo
Hojoformo asked on
DB2Visual Basic.NETMicrosoft Development
2 Comments2 Solutions5497 ViewsLast Modified:
I need some help with using the DB2 current date in my select where clause below for my VB program.   I know this is not the correct format.    Can someone please help.        
oCant.Append " And F.DT_RDG_TO < " & SELECT CURRENT_DATE FROM SYSIBM.SYSDUMMY1 oCant.Append " AND F.DT_RDG_TO > " & SELECT CURRENT_DATE - 12 MONTHS FROM SYSIBM.SYSDUMMY1            

Here is my Db2 SQL:
oCant.Str = "select "
                     oCant.Append " F.QY_DA_USE, "
                    oCant.Append " F.DT_RDG_TO, "
                    oCant.Append " F.KY_RDG_SEQ_NO "
                   oCant.Append " From "
                    oCant.Append strDBName & ".CU04TB08_RDCONSHDR F "
                    oCant.Append " Where "
                     oCant.Append " And A.KY_BA = F.KY_BA "
                    oCant.Append " And F.DT_RDG_TO < " & SELECT CURRENT_DATE FROM SYSIBM.SYSDUMMY1
                    oCant.Append " AND F.DT_RDG_TO > " & SELECT CURRENT_DATE - 12 MONTHS FROM SYSIBM.SYSDUMMY1
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros