Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mid Function against SQL2000

Status
Not open for further replies.

jake29

IS-IT--Management
Jan 4, 2004
76
US
I am trying to do something that seems simple.
I want to parse a int field. It always contains 8 characters. The field is used to hold a date yyyymmdd
I need to pull the characters 5 and 6. I can pull the first 4 (Left()) and last 2 (Right()) but the middle 2? Mid() would be the perfect match except I am running this against a SQL2K box.

<cfquery datasource="invoice" name="getInvDate">
select ord_dt, left(ord_dt, 4) as y, mid(ord_dt,5,6) as m
from dbo_OEORDHDR
where slspsn_no = 'I01'
order by y, m
</cfquery>

Any ideas??
 
Yes thanks, I tried that. The problem is it's datatype is a integer. So the results come back as invalid.
 
Thank you r937.

That is it. I had look at Cast, but never used it before.

Again thanks.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top