Fw: Select Date_Add help

2002-08-04 Thread John Fishworld



 Please !

 I thought I had this working, but it seems unfortunately not !!!

 I'm trying to list events for each month and my select query is as follows

 SELECT DISTINCT t_city_name,t_city_id_city FROM
 t_city,t_zipcodecity,t_location,t_event WHERE (t_city_id_city =
 t_zipcodecity_id_city) AND (t_zipcodecity_zipcode = t_location_zipcode )
AND
 ((t_location_sex = 4) OR (t_location_sex = 6) OR (t_location_sex = 0)) AND
 (t_location_id_location = t_event_id_location) AND (t_event_date 
 (DATE_ADD('2002-08-01 00:00:00', INTERVAL 31 day)) ) AND (t_event_date 
 '2002-08-01 00:00:00') ORDER by t_city_name

 this is for August and seems to work fine, but my problem is that in the
 running month I only want to show the still forthcoming events so for
today
 July the 31 st my query looks like this

 SELECT DISTINCT t_city_name,t_city_id_city FROM
 t_city,t_zipcodecity,t_location,t_event WHERE (t_city_id_city =
 t_zipcodecity_id_city) AND (t_zipcodecity_zipcode = t_location_zipcode )
AND
 ((t_location_sex = 4) OR (t_location_sex = 6) OR (t_location_sex = 0)) AND
 (t_location_id_location = t_event_id_location) AND (t_event_date 
 (DATE_ADD('2002-07-31 00:00:00', INTERVAL 0 day)) ) AND (t_event_date 
 '2002-07-31 00:00:00') ORDER by t_city_name

 But it doesn't work ??
 Can anyone give me a hint in the right direction ??
 The problem is definately in the last part  (t_event_date 
 (DATE_ADD('2002-07-31 00:00:00', INTERVAL 0 day)) ) AND (t_event_date 
 '2002-07-31 00:00:00')

 Thanks in advance








-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Select Date_Add help

2002-07-31 Thread John Fishworld

Please !

I thought I had this working, but it seems unfortunately not !!!

I'm trying to list events for each month and my select query is as follows

SELECT DISTINCT t_city_name,t_city_id_city FROM
t_city,t_zipcodecity,t_location,t_event WHERE (t_city_id_city =
t_zipcodecity_id_city) AND (t_zipcodecity_zipcode = t_location_zipcode ) AND
((t_location_sex = 4) OR (t_location_sex = 6) OR (t_location_sex = 0)) AND
(t_location_id_location = t_event_id_location) AND (t_event_date 
(DATE_ADD('2002-08-01 00:00:00', INTERVAL 31 day)) ) AND (t_event_date 
'2002-08-01 00:00:00') ORDER by t_city_name

this is for August and seems to work fine, but my problem is that in the
running month I only want to show the still forthcoming events so for today
July the 31 st my query looks like this

SELECT DISTINCT t_city_name,t_city_id_city FROM
t_city,t_zipcodecity,t_location,t_event WHERE (t_city_id_city =
t_zipcodecity_id_city) AND (t_zipcodecity_zipcode = t_location_zipcode ) AND
((t_location_sex = 4) OR (t_location_sex = 6) OR (t_location_sex = 0)) AND
(t_location_id_location = t_event_id_location) AND (t_event_date 
(DATE_ADD('2002-07-31 00:00:00', INTERVAL 0 day)) ) AND (t_event_date 
'2002-07-31 00:00:00') ORDER by t_city_name

But it doesn't work ??
Can anyone give me a hint in the right direction ??
The problem is definately in the last part  (t_event_date 
(DATE_ADD('2002-07-31 00:00:00', INTERVAL 0 day)) ) AND (t_event_date 
'2002-07-31 00:00:00')

Thanks in advance






-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Date

2002-05-22 Thread John Fishworld


 Can someone help me with the correct sytax here !
 I'm trying to show results from the last two days(or week etc)

 This is what I've got as my sql query

 SELECT .
 WHERE.
 AND ( (DATE_SUB(j.stellen.t_stellen_date INTERVAL 2 day) 
 j.stellen.t_stellen_date)

 but it doesn't work !

 What's wrong ?

 The t_stellen_date field is a date field !

 Thanks




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Temporary Tables

2002-02-27 Thread John Fishworld


 You have written the following:

I understand the principles but WHEN should they be used or considered ??

Any help appreciated

 tia
 John

 sql,query




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php