Q:

can we implement innerjoin in the following sql query

These are my tables: 
CREATE TABLE forgerock (id INT, [date] DATETIME, empcode INT,[file] VARCHAR);
INSERT INTO forgerock
VALUES
    (1, '2015-12-31 01:20:02', 56, 'abc1'),
    (2, '2016-01-01 01:20:02', 58, 'abc2'),
    (3, '2016-01-02 01:20:02', 46, 'abc3'),
    (4, '2016-01-03 01:20:02', 16, 'abc4'),
    (5, '2016-01-04 01:20:02', 36, 'abc5');

CREATE TABLE forge (empcode INT, [user_name] VARCHAR);
INSERT INTO forge
VALUES
    (56, 'ram'),
    (58, 'ram1'),
    (46, 'ram2'),
    (16, 'ram3'),
    (36, 'ram4');

I am trying to print the file name and user_name from the tables with respect to current date and the day before the current date.
I tried the query:
ResultSet resultset = statement.executeQuery("select file  from forgerock where '"+date+"' >= CURRENT_DATE('"+date+"', INTERVAL 1 DAY);") ;

but I got the exception:    

Incorrect syntax near the keyword 'CURRENT_DATE'.

A:

Since am using ms sql the code should be the following way
 SELECT fr.file, f.user_name FROM forgerock fr inner join forge f on fr.empcode = f.empcodewhere [date] >= DATEADD(DAY, DATEDIFF(DAY,0,GETDATE()-1),0)

which will result in printing the two tables file from forgerock and user_name from forge

