vijay.k
vijay.k

Reputation: 23

How to use current date in a sql query of Db2

I need a query to insert current date in a sql query. Below query works when in my DB2.

select * from H1TI1.PS_CAL_DETP_TBL  where END_DT='2000-02-25' with ur;

I need to put current date as following END_DT = CURRENT_DATE .

And also want to use COUNT function to count how many rows i get as a result.

Thanking you in advance.

Upvotes: 0

Views: 5548

Answers (1)

Cannon
Cannon

Reputation: 168

select Count(*) from H1TI1.PS_CAL_DETP_TBL  where END_DT = CURRENT DATE with ur;

Count will count all the rows where END_DT is equal to Current Date(DB2 has this as a built in function).

Upvotes: 2

Related Questions