Jump to content

[SOLVED] Setting Field Length Of Result of Query


millsy007

Recommended Posts

I have a query that brings though a list of passenger names, is there a way in which I can set the length of each of these names to equal 10 characters. So even if I have shorter names eg  "bob, demarcus, adam and scott" they would display with the shorter names filled as spaces, eg:

 

bob      |demarcus  |adam        |scott

 

My Query is:

 

(SELECT  tb2.journey_dttm as departure, ('8' - tb2.occupancy) AS seats,

(SELECT IF(GROUP_CONCAT(passenger_name SEPARATOR '|') IS NULL, '', GROUP_CONCAT(passenger_name ORDER BY passenger_name SEPARATOR '|')) 

FROM passengers WHERE journey_id = tb2.id ORDER BY passenger_name) AS passengers FROM shuttle AS tb1 LEFT JOIN journey AS tb2 ON  ";

( tb1.id = tb2.shuttle_id ) LEFT JOIN trip_route AS tb3 ON ( tb2.route_id = tb3.id )

WHERE tb1.depart_dttm = '$depart_dttm' ORDER BY tb2.id ASC, tb2.route_id ASC);

 

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.