Need help in insert date statement

Database

Need help in insert date statement

Hi,

Here is my insert statement.

CREATE  VOLATILE TABLE A (ClickLoad_Dt DATE FORMAT 'yyyy/mm/dd');

INSERT INTO A(ClickLoad_Dt)
SELECT MAX(CAST (click_dt AS DATE FORMAT 'yyyy/mm/dd') ) FROM B;

SELECT * FROM A

I get and empty table even though the answer to below query is 5/25/2015

SELECT MAX(click_dt) FROM B

I am not able to figure out what is happening. I appreciate all the help I can get.

Tags (2)
2 REPLIES

Re: Need help in insert date statement

Hi.

ON COMMIT PRESERVE ROWS is missing in your CREATE TABLE definition.

Cheers.

Carlos.

Re: Need help in insert date statement

Thanks man...... working perfectly now.... Such a small thing.... :)