SQL Syntax questions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table where I have width and hieght in one column IE. 11 x 14, I
would like to do a query where I grab the first number (11) as width and the
second number (14) as hieght. I am new to SQL and just can't find any help on
this from other websites.
 
I would suggest the better alternative and less troublesome is to re-design
the Table and use 2 Fields, one for Width and one for Height.

Rember that the First Normal Form of the Relational Design Theory is that
data must be atomic, i.e. a *single* value store in a Field, not 2 or more
in a single Field.
 
T-SQL offers string functions but their syntax is not exactly as the same as
those from VBA. For some examples of T-SQL string functions:

http://www.informit.com/guides/content.asp?g=sqlserver&seqNum=88

You can also write 2 User Defined Function (UDF) to make your select
statement more clearer.

Finally, as the client is Access, I think that you can also use VBA
functions if you are writing the SQL query string directly in the VBA code
instead of using a query procedure running on the server. However, don't do
this if you want to use the Width and the Height in the Where clause,
because it will force Access to retrieve all the records from the database.
With the T-SQL string functions, you can also have this kind of problem.

S. L.
 
Back
Top