Prev: A severe error occurred on the current command. The results,if any, should be discarded
Next: concatenating and two decimal places
From: --CELKO-- on 23 May 2010 22:01 >> I have a field [sic] named itemSize .. << Here is the root of your problems. You are still thinking in terms of COBOL files and don't know the differences between columns and fields. >> What would be the best way to drop the inch character and get a true sort? << Yes, of course! This is a numeric data elemebt, so you use a numeric data type. You are doing display formatting in the DDL ande not in the appllcations. Would also store dollar amounts as strings with $ and commas? No, of course not. This came up in a "Bad SQL" session at SQL Saturday when we ere telling horror stories. The schema designer knew web pages and no SQL. Every column was a VARCHAR(n) The amount of CASTing that had to be done for any report was insane. But it made nice web pages .
From: J M De Moor on 24 May 2010 14:37
> > This is a numeric data elemebt[sic], so you use a numeric > data type. Of course, Celko brings up an important point here that I should have mentioned, too. A lot of programmers in this NG claim they don't have a say in the table design, but neither my nor Gert-Jan's code will work should your front end slip in a value like , e.g., 'na' instead of 'n/a'. Or if there is another unit of measure, or if someone enters 'in' instead of the double quote, etc. You get the idea. Joe De Moor |