A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Referring to a text field in SQL



 
 
Thread Tools Display Modes
  #1  
Old February 25th, 2007, 02:30 PM posted to microsoft.public.access.queries
Steve
external usenet poster
 
Posts: 2,662
Default Referring to a text field in SQL

Hi,

This function with SQL statement parameter works fine when the field MRN is
a number field but it does not work when MRN is a text field. How do I refer
to the field in the SQL statement when it is a text field? Thanks.

ConcatDx("SELECT [Procedure(s)] FROM qryConcatProc WHERE MRN =" &
TblPatient.MRN)
  #2  
Old February 25th, 2007, 02:48 PM posted to microsoft.public.access.queries
Jeff Boyce
external usenet poster
 
Posts: 1,555
Default Referring to a text field in SQL

Steve

Text needs to be delimited. You could try something like:

WHERE MRN ='" & TblPatient.MRN & "'"
(single quote marks)

If those don't work, you might try using double-quote marks (but this gets a
bit trickier, as you need to add multiple "s).

--
Regards

Jeff Boyce
Microsoft Office/Access MVP
http://mvp.support.microsoft.com/

Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/

"Steve" wrote in message
...
Hi,

This function with SQL statement parameter works fine when the field MRN

is
a number field but it does not work when MRN is a text field. How do I

refer
to the field in the SQL statement when it is a text field? Thanks.

ConcatDx("SELECT [Procedure(s)] FROM qryConcatProc WHERE MRN =" &
TblPatient.MRN)


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:27 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.