Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9008

Re: Data viewing tool

$
0
0

hi Matt,

 

you may be able to look after this in crystal...this is a good use for sql expressions.

 

create a new SQL Expression with the name "First" with syntax like

 

{fn ASCII({fn LEFT(`Customer`.`Customer Name`, 1)})}

 

substituting the customer.customername field for your field. this will return the ascii value of the first character of the field and should help you avoid writing any instr() searches etc.

 

now in your record selection, you can also put something like

 

{%First} > 32

 

which will ensure that the first character of your text field is greater than a space. this is also processed on your database for better performance. this is evidenced by the Show SQL Query which gives you something like

 

SELECT `Customer`.`Customer Name`, {fn LOCATE({fn CHAR(32)},`Customer`.`Customer Name`)}, {fn ASCII({fn LEFT(`Customer`.`Customer Name`, 1)})}
FROM   `Customer` `Customer`
WHERE  {fn ASCII({fn LEFT(`Customer`.`Customer Name`, 1)})}>32


i hope this helps,

jamie


Viewing all articles
Browse latest Browse all 9008

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>