How can i search in xml document?

  • Thread starter Thread starter Julia
  • Start date Start date
J

Julia

Hi,
I am storing XML document in a column

And I need to be able to run a query which retrieve all rows
in which the document contain <FirstName="Julia"> or "Julie" etc....(using
LIKE)
I can use either access 2000\xp or 2003


Thanks in advance.
 
Julia said:
Hi,
I am storing XML document in a column

And I need to be able to run a query which retrieve all rows
in which the document contain <FirstName="Julia"> or "Julie" etc....(using
LIKE)
I can use either access 2000\xp or 2003

SELECT *
FROM TableName
WHERE FieldName Like "*<FirstName=" & Chr(34) & "Julia" & Chr(34) & ">*"
 
Julia said:
Thanks
and if i want to use order by on the FirstName,is it possible?

Possible, but it would be a pretty inefficient query so I wouldn't recommend it
unless the table is pretty small. You would need to use InStr() and Mid() to
pull say 5 or 6 characters after the occurrence of "<FirstName=" and then sort
on that.

SELECT TableName.*
FROM TableName
ORDER BY Mid(InStr(1, FieldName, "<FirstName=") + 12), 6)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top