> I have a table that has three fields: Paragraph, Title, Content.
>
> The Paragraph field is a text field, but is the outline number for the
> particular paragraph in a document.  For example, 7.1.1, 7.1.2, etc.
>
> I need to output these paragraphs in outline order as they appear in the
> printed material.  Of course, if the paragraphs go past 9, it gets all
> muffed up because its a text field and not a number field.  Example: 7.1,
> 7.10, 7.11, 7.2, 7.3...
>
> Is there any easy way to accomplish this?

I assume that since you've got 7.? there, it could go up to 10.?

If this is the case, then it's a little more complex, but still workable

Assuming SQL Server;
Order by Int(Val(Paragraph)),
Val(SubString(Paragraph,CharIndex('.',Paragraph)+1,Len(Paragraph)))

What this will do is Int the number of the paragraph (in your example, 7)
and then provide the value of everything after the "." - there is no error
checking for if there isn't a dot (which will produce "7" if it's just "7"),
also it won't handle multiple levels

Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to