Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

view:  cs_storagelocations1  (refreshed 2012-04-1926)

Code Block
sql
sql
SELECT
  'sl'+ltrim(str(l.LocationID)) shortIdentifier,
  (case when l.active = 1 then 'accepted' else 'rejected' end) locationStatus,
  l.LocationString displayName,
  l.Site+', '+l.Room Parent,
  l.Site Site,
  l.Room Room,
  l.UnitType UnitType,
  l.UnitNumber UnitNumber,
  l.UnitPosition UnitPosition,
  (case when l.Description = '' then '' else 'Description: '+l.Description end) locNote
FROM
  locations l
;

...

view:  cs_storagelocations2  (refreshed 2012-04-1926)

Code Block
sql
sql
SELECT
  'cr'+ltrim(str(c.crateID)) shortIdentifier,
  (case when c.active = 1 then 'accepted' else 'rejected' end) locationStatus,
  (case when CharIndex(replace(c.CrateNumber,'-',', '),l.LocationString) > 0 then l.LocationString else l.LocationString+', '+c.CrateNumber end) displayName,
  l.LocationString Parent,
  l.Site Site,
  l.Room Room,
  l.UnitType UnitType,
  l.UnitNumber UnitNumber,
  l.UnitPosition UnitPosition,
  'CrateNumber: '+' '+c.CrateNumber locNote
FROM
  crates c
  JOIN Locations l ON l.LocationID = c.LocationID
;

...