Author Topic: playlist (querty not)  (Read 357 times)

onno1980

  • New User

  • Offline
  • *
  • 47
playlist (querty not)
« on: November 22, 2016, 09:54:45 AM »
Dear dj's


I make a list in a playlist of songs that can not be rotated in a given hour. in querty I want to write it off as (IS NULL or NOT). but unfortunately I can not.

I have now:
Code: [Select]
SELECT `songs`.`ID`, `songs`.`artist`, `songs`.`title` FROM `songs`
LEFT JOIN `queuelist` ON (`songs`.`ID` = `queuelist`.`songID` OR `songs`.`artist` = `queuelist`.`artist`)
LEFT JOIN `playlists_list` ON (`songs`.`ID` = `playlists_list`.`sID`)
WHERE `id_subcat`=59
AND (`year` Between 1980 and 1989)
AND ((`start_date` <= Now()) AND (`end_date` >= NOW() OR `end_date` = '2002-01-01 00:00:01'))
AND ((TIMESTAMPDIFF(MINUTE, `songs`.`date_played`, NOW()) > $TrackRepeatInterval$) AND (TIMESTAMPDIFF(MINUTE, `songs`.`artist_played`, NOW()) > $ArtistRepeatInterval$))
AND (`queuelist`.`songID` IS NULL OR `queuelist`.`artist` IS NULL)
AND NOT (`playlists_list`.`pID` = 31)
ORDER BY `date_played` ASC
LIMIT 1;

AND I have:

Code: [Select]
SELECT `songs`.`ID`, `songs`.`artist`, `songs`.`title` FROM `songs`
LEFT JOIN `queuelist` ON (`songs`.`ID` = `queuelist`.`songID` OR `songs`.`artist` = `queuelist`.`artist`)
LEFT JOIN `playlists_list` ON (`songs`.`ID` = `playlists_list`.`sID`)
WHERE (`id_subcat`=59, `playlists_list`.`pID` = 31)
AND `year` Between 1980 and 1989
AND ((`start_date` <= Now()) AND (`end_date` >= NOW() OR `end_date` = '2002-01-01 00:00:01'))
AND ((TIMESTAMPDIFF(MINUTE, `songs`.`date_played`, NOW()) > $TrackRepeatInterval$) AND (TIMESTAMPDIFF(MINUTE, `songs`.`artist_played`, NOW()) > $ArtistRepeatInterval$))
AND (`queuelist`.`songID` IS NULL OR `queuelist`.`artist` IS NULL)
AND (`playlists_list`.`sID` IS NULL)
ORDER BY `date_played` ASC
LIMIT 1;

Unfortunately this does not work. Can someone help me with this?
greetz onno