lundi 30 novembre 2015

SQL, insert data into free column acording to date difference

I have got a problem. I'm a real beginer in SQL. I work on BI project and I need to create data warehouse.

My current problem is this:

I have got a table into which I push data from external Microsoft Access. In those data are two dates (billing info) and I need to generate an info into this table if there is delay in payment (there is free column in the table named delay into which I need to generate YES/NO according to if the date of payment is later then date of "need" of payment)

So I have in mind something like this:

INSERT INTO TABLE billing,
VALUES (YES)
IF DATE1 > DATE2,
ELSE VALUE (NO)

... I know this is no SQL but its just to get the idea.

If someone know something which could help me I would be grateful. Thanks

Aucun commentaire:

Enregistrer un commentaire