Hello Folks,
I have an interesting problem, let me start off with, this database is not of my design, is an absolute mess, and there is nothing I can do about it.
That be the query I am using, at the moment. the only place where I am having problems is on the ObjectCustomFie ldValues table. In that table there are 2 identifiers that I can use to pull data, the ObjectId and the CustomField, The CustomField is for equating a line with an actual custom field ID (elsewhere in the database), and the Object ID is a global ID through out the database. I need two different pieces of information from this table in a single call, and I am stumped.
I would like to see the sev and tt as separate columns with the data for their CustomField id in each row returned.
If I cannot figure this out, I'll just start writing to a more useful database, where the information for each field I need in in a separate column or table etc... I am just hoping I can get some help before it gets to this point.
Thanks,
TC
I have an interesting problem, let me start off with, this database is not of my design, is an absolute mess, and there is nothing I can do about it.
Code:
SELECT distinct(`Tickets`.`EffectiveId`), `Tickets`.`Subject`, `Tickets`.`Created`, `Transactions`.`OldValue`, `Transactions`.`NewValue`, `Transactions`.`Created` as `Tcreated`, `ObjectCustomFieldValues`.`Content` as `sev`, `ObjectCustomFieldValues`.`Content` as `tt` from `Tickets` Left join (`Transactions`, `ObjectCustomFieldValues`) on (`Tickets`.`EffectiveId` = `Transactions`.`ObjectId` and `ObjectCustomFieldValues`.`ObjectId` = `Tickets`.`EffectiveId`) where `Tickets`.`id` = `Tickets`.`EffectiveId` and `Tickets`.`Created` >='2009-08-01 07:00:00' and `Tickets`.`Created` <= '2009-08-31 23:59:59' and (`Tickets`.`Status` = 'resolved' or `Tickets`.`Status` = 'closed') and `Transactions`.`Type` = 'Status' and (`ObjectCustomFieldValues`.`CustomField` = '32' or `ObjectCustomFieldValues`.`CustomField`= '24') and `ObjectCustomFieldValues`.`Disabled` = '0' order by `Tcreated`, `Tickets`.`EffectiveId` asc;
I would like to see the sev and tt as separate columns with the data for their CustomField id in each row returned.
If I cannot figure this out, I'll just start writing to a more useful database, where the information for each field I need in in a separate column or table etc... I am just hoping I can get some help before it gets to this point.
Thanks,
TC
Comment