Partial Name Prompt Question

B

bdehning

I currently have the following SQL which works fine but requires me to enter the whole Servicing Division such as Henderson.

How do I add Like[Enter Servicing Division] & "*" without getting sytax errors so I can type only a patial name such as Hen to pull it up.

SELECT [SERVICE CALL NUMBER],[ACCOUNT NAME],[ASSIGNED CONSULTANT],[COUNTOFASSIGNED CONSULTANT],[LOCATION SERVICING DIVISION],[POLICY NUMBER],[SCHEDULED SERVICE MONTH],[LOCATION ADDRESS],[LOCATION CITY],[LOCATION STATE],[ORIGINAL SERVICE CALL DATE],[EXPIRATION DATE],[COMMENTS],[SERVICE CALL TYPE],[EAP],[COUNTOFSCHEDULED SERVICE MONTH]
FROM[TOTAL OUTSTANDING SERVICE CALLS BY CONSULTANT]
WHERE(([SCHEDULED SERVICE MONTH] >[RESCHEDULED SERVICE MONTH] OR [RESCHEDULED SERVICE MONTH] IS NULL) and [Location Servicing Division] =[Enter Servicing Division])

UNION ALL SELECT [SERVICE CALL NUMBER],[ACCOUNT NAME],[ASSIGNED CONSULTANT],[COUNTOFASSIGNED CONSULTANT],[LOCATION SERVICING DIVISION],[POLICY NUMBER],[RESCHEDULED SERVICE MONTH],[LOCATION ADDRESS],[LOCATION CITY],[LOCATION STATE],[ORIGINAL SERVICE CALL DATE],[EXPIRATION DATE],[COMMENTS],[SERVICE CALL TYPE],[EAP],[COUNTOFSCHEDULED SERVICE MONTH]
FROM[TOTAL OUTSTANDING SERVICE CALLS BY CONSULTANT]
WHERE([RESCHEDULED SERVICE MONTH] >[SCHEDULED SERVICE MONTH] and [Location Servicing Division] =[Enter Servicing Division]);
 
M

matt

try using the left function. i.e.
Left([servicing division],3)
then in the criteria type, [enter servicing division].
when HEN is typed in the prompt, Henderson will be brought
up.
-----Original Message-----
I currently have the following SQL which works fine but
requires me to enter the whole Servicing Division such as
Henderson.
How do I add Like[Enter Servicing Division] & "*"
without getting sytax errors so I can type only a patial
name such as Hen to pull it up.
SELECT [SERVICE CALL NUMBER],[ACCOUNT NAME],[ASSIGNED
CONSULTANT],[COUNTOFASSIGNED CONSULTANT],[LOCATION
SERVICING DIVISION],[POLICY NUMBER],[SCHEDULED SERVICE
MONTH],[LOCATION ADDRESS],[LOCATION CITY],[LOCATION STATE],
[ORIGINAL SERVICE CALL DATE],[EXPIRATION DATE],[COMMENTS],
[SERVICE CALL TYPE],[EAP],[COUNTOFSCHEDULED SERVICE MONTH]
FROM[TOTAL OUTSTANDING SERVICE CALLS BY CONSULTANT]
WHERE(([SCHEDULED SERVICE MONTH] >[RESCHEDULED SERVICE
MONTH] OR [RESCHEDULED SERVICE MONTH] IS NULL) and
[Location Servicing Division] =[Enter Servicing Division])
UNION ALL SELECT [SERVICE CALL NUMBER],[ACCOUNT NAME],
[ASSIGNED CONSULTANT],[COUNTOFASSIGNED CONSULTANT],
[LOCATION SERVICING DIVISION],[POLICY NUMBER],[RESCHEDULED
SERVICE MONTH],[LOCATION ADDRESS],[LOCATION CITY],
[LOCATION STATE],[ORIGINAL SERVICE CALL DATE],[EXPIRATION
DATE],[COMMENTS],[SERVICE CALL TYPE],[EAP],
[COUNTOFSCHEDULED SERVICE MONTH]
FROM[TOTAL OUTSTANDING SERVICE CALLS BY CONSULTANT]
WHERE([RESCHEDULED SERVICE MONTH] >[SCHEDULED SERVICE
MONTH] and [Location Servicing Division] =[Enter Servicing
Division]);
 
G

Gary Walter

Hi Brian,

It seems like twice you have typed
"Like" without a following space
between it and the parameter.

bdehning said:
I tried that but still got syntax error. I am more familiar with Like[Enter
Servicing Division] & "*" which works in my other design grid queries.
Does it have to do with proper( )?
--
Brian


matt said:
try using the left function. i.e.
Left([servicing division],3)
then in the criteria type, [enter servicing division].
when HEN is typed in the prompt, Henderson will be brought
up.
-----Original Message-----
I currently have the following SQL which works fine but
requires me to enter the whole Servicing Division such as
Henderson.
How do I add Like[Enter Servicing Division] & "*"
without getting sytax errors so I can type only a patial
name such as Hen to pull it up.
SELECT [SERVICE CALL NUMBER],[ACCOUNT NAME],[ASSIGNED
CONSULTANT],[COUNTOFASSIGNED CONSULTANT],[LOCATION
SERVICING DIVISION],[POLICY NUMBER],[SCHEDULED SERVICE
MONTH],[LOCATION ADDRESS],[LOCATION CITY],[LOCATION STATE],
[ORIGINAL SERVICE CALL DATE],[EXPIRATION DATE],[COMMENTS],
[SERVICE CALL TYPE],[EAP],[COUNTOFSCHEDULED SERVICE MONTH]
FROM[TOTAL OUTSTANDING SERVICE CALLS BY CONSULTANT]
WHERE(([SCHEDULED SERVICE MONTH] >[RESCHEDULED SERVICE
MONTH] OR [RESCHEDULED SERVICE MONTH] IS NULL) and
[Location Servicing Division] =[Enter Servicing Division])
UNION ALL SELECT [SERVICE CALL NUMBER],[ACCOUNT NAME],
[ASSIGNED CONSULTANT],[COUNTOFASSIGNED CONSULTANT],
[LOCATION SERVICING DIVISION],[POLICY NUMBER],[RESCHEDULED
SERVICE MONTH],[LOCATION ADDRESS],[LOCATION CITY],
[LOCATION STATE],[ORIGINAL SERVICE CALL DATE],[EXPIRATION
DATE],[COMMENTS],[SERVICE CALL TYPE],[EAP],
[COUNTOFSCHEDULED SERVICE MONTH]
FROM[TOTAL OUTSTANDING SERVICE CALLS BY CONSULTANT]
WHERE([RESCHEDULED SERVICE MONTH] >[SCHEDULED SERVICE
MONTH] and [Location Servicing Division] =[Enter Servicing
Division]);
 
B

bdehning

Here is my SQL. Can Someone help place Like[Enter Servicing Division] & "*" in place of [Enter Servicing Division] in the SQL below? I still get syntax errors if using spacing between Like and [

SELECT [SERVICE CALL NUMBER],[ACCOUNT NAME],[ASSIGNED CONSULTANT],[COUNTOFASSIGNED CONSULTANT],[LOCATION SERVICING DIVISION],[POLICY NUMBER],[SCHEDULED SERVICE MONTH],[LOCATION ADDRESS],[LOCATION CITY],[LOCATION STATE],[ORIGINAL SERVICE CALL DATE],[EXPIRATION DATE],[COMMENTS],[SERVICE CALL TYPE],[EAP],[COUNTOFSCHEDULED SERVICE MONTH]
FROM[TOTAL OUTSTANDING SERVICE CALLS BY CONSULTANT]
WHERE(([SCHEDULED SERVICE MONTH] >[RESCHEDULED SERVICE MONTH] OR [RESCHEDULED SERVICE MONTH] IS NULL) and [Location Servicing Division] =[Enter Servicing Division])

UNION ALL SELECT [SERVICE CALL NUMBER],[ACCOUNT NAME],[ASSIGNED CONSULTANT],[COUNTOFASSIGNED CONSULTANT],[LOCATION SERVICING DIVISION],[POLICY NUMBER],[RESCHEDULED SERVICE MONTH],[LOCATION ADDRESS],[LOCATION CITY],[LOCATION STATE],[ORIGINAL SERVICE CALL DATE],[EXPIRATION DATE],[COMMENTS],[SERVICE CALL TYPE],[EAP],[COUNTOFSCHEDULED SERVICE MONTH]
FROM[TOTAL OUTSTANDING SERVICE CALLS BY CONSULTANT]
WHERE([RESCHEDULED SERVICE MONTH] >[SCHEDULED SERVICE MONTH] and [Location Servicing Division] =[Enter Servicing Division]);

--
Brian


Gary Walter said:
Hi Brian,

It seems like twice you have typed
"Like" without a following space
between it and the parameter.

bdehning said:
I tried that but still got syntax error. I am more familiar with Like[Enter
Servicing Division] & "*" which works in my other design grid queries.
Does it have to do with proper( )?
--
Brian


matt said:
try using the left function. i.e.
Left([servicing division],3)
then in the criteria type, [enter servicing division].
when HEN is typed in the prompt, Henderson will be brought
up.

-----Original Message-----
I currently have the following SQL which works fine but
requires me to enter the whole Servicing Division such as
Henderson.

How do I add Like[Enter Servicing Division] & "*"
without getting sytax errors so I can type only a patial
name such as Hen to pull it up.

SELECT [SERVICE CALL NUMBER],[ACCOUNT NAME],[ASSIGNED
CONSULTANT],[COUNTOFASSIGNED CONSULTANT],[LOCATION
SERVICING DIVISION],[POLICY NUMBER],[SCHEDULED SERVICE
MONTH],[LOCATION ADDRESS],[LOCATION CITY],[LOCATION STATE],
[ORIGINAL SERVICE CALL DATE],[EXPIRATION DATE],[COMMENTS],
[SERVICE CALL TYPE],[EAP],[COUNTOFSCHEDULED SERVICE MONTH]
FROM[TOTAL OUTSTANDING SERVICE CALLS BY CONSULTANT]
WHERE(([SCHEDULED SERVICE MONTH] >[RESCHEDULED SERVICE
MONTH] OR [RESCHEDULED SERVICE MONTH] IS NULL) and
[Location Servicing Division] =[Enter Servicing Division])

UNION ALL SELECT [SERVICE CALL NUMBER],[ACCOUNT NAME],
[ASSIGNED CONSULTANT],[COUNTOFASSIGNED CONSULTANT],
[LOCATION SERVICING DIVISION],[POLICY NUMBER],[RESCHEDULED
SERVICE MONTH],[LOCATION ADDRESS],[LOCATION CITY],
[LOCATION STATE],[ORIGINAL SERVICE CALL DATE],[EXPIRATION
DATE],[COMMENTS],[SERVICE CALL TYPE],[EAP],
[COUNTOFSCHEDULED SERVICE MONTH]
FROM[TOTAL OUTSTANDING SERVICE CALLS BY CONSULTANT]
WHERE([RESCHEDULED SERVICE MONTH] >[SCHEDULED SERVICE
MONTH] and [Location Servicing Division] =[Enter Servicing
Division]);
 

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

Top