Jump to content

Date Selection


draconlock

Recommended Posts

Hi Everyone, 

 

I have a problem.  So here is my setup.

 

TABLE1

id | firstname

------------------------

1 | John

2 | Susan

3 | Michael

 

TABLE2

userid | date | payment

-------------------------------

1 | 2009-12-28 | Unpaid

2 | 2010-02-10 | Paid

3 | 2010-02-28 | Unpaid

 

This is my select statement

select table1.id, table1.firstname, table2.userid, table2.date, table2.payment from table1 inner join table2 on table2.userid=table1.id where payment='Unpaid' order by table1.id

 

My problem is I want to only select/print the row, where the date is past due and unpaid.

 

Can someone help me figure this out, I can't get it to work and i'm new at this.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/191414-date-selection/
Share on other sites

wat is the date for, in 2nd table?

payment due date?

select table1.id, table1.firstname, table2.userid, table2.date, table2.payment from table1 inner join table2 on table2.userid=table1.id where payment='Unpaid' and unix_timestamp(table2.date)>now() order by table1.id

 

now() might not be the correct function, so u need to figure out

Link to comment
https://forums.phpfreaks.com/topic/191414-date-selection/#findComment-1009089
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.