Jump to content

[SOLVED] Whats wrong with my CROSS JOIN?


matt.sisto

Recommended Posts

Hi all I am trying to write an sql statement that will retrieve all the stored data necessary to compile an invoice.

 

SELECT event_id, event_start, event_end, fee FROM calendar_events WHERE event_start = '2009-06-01' AND event_end = '2009-06-30' CROSS JOIN client USING (client_id) WHERE org_id = '9'

 

Any help appreciated, thanks and regs.

Link to comment
https://forums.phpfreaks.com/topic/157068-solved-whats-wrong-with-my-cross-join/
Share on other sites

SELECT event_id, event_start, event_end, fee
FROM calendar_events
CROSS JOIN client
USING (client_id)
WHERE calendar_events.event_start = '2009-06-01'
AND calendar_events.event_end = '2009-06-30'
AND client.org_id = '9'

 

I have modified it to this but it is returning an empty result. ???

I have sorted it now, thanks for your help:

 

<?php
$sql = "SELECT event_id, event_start, event_end, fee FROM calendar_events CROSS JOIN client USING (client_id) WHERE calendar_events.event_start >= '".$invoice_start."' AND calendar_events.event_end <= '".$invoice_end."' AND client.org_id = '".$org_id."'";
?>

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.