[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] Re: prompt user for date




The default &name for a columns is the column name preceded by the ampersand.  
So when your select emplid without a &name, it gets &emplid and you already 
have &emplid from another select.

BEGIN-SELECT
EMPLID &emp_emplid
   LET $EMPLID=&emp_EMPLID
HIRE_DT
FROM PS_EMPLOYMENT emp WHERE HIRE_DT >=$BEGIN_DT AND &HIRE_DT <=$END_DT
END-SELECT

You could save some time if you joined your two queries.  That what relational 
databases do well.

Richard Knapp
Database Programmer/Analyst
Institutional Research and Planning
University of Missouri System
573-882-8856
knappr@umsystem.edu


-----Original Message-----
From: Lisa Kelsey [mailto:lkelsey@alamo-group.com]
Sent: Wednesday, August 06, 2003 8:52 AM
To: sqr-users@sqrug.org
Subject: [sqr-users] Re: prompt user for date


Thanks for the responses, everyone, the error is gone!  I have one error left
in the file, still need help. In the procedure get personal data, I get the
following error: Error on line 33:   (SQR 3719) Columns names and expressions
must be unique or be given unique pseudonyms (&name).
EMPLID Errors were found in the program file.
SQR: Program Aborting. The error is referring to the line with emplid under
the procedure get personal data.

Here's the code:

BEGIN-PROCEDURE MAIN
!PROMPT USER TO ENTER BEGIN AND END DATE
INPUT $BEGIN_DT 'ENTER BEGIN DATE' TYPE MM-DD-YYYY
INPUT $END_DT 'ENTER END DATE' TYPE MM-DD-YYYY

BEGIN-SELECT
EMPLID
   LET $EMPLOYMENT.EMPLID=&EMPLID
HIRE_DT
FROM PS_EMPLOYMENT WHERE HIRE_DT >=$BEGIN_DT AND &HIRE_DT <=$END_DT
END-SELECT
END-PROCEDURE MAIN

BEGIN-PROCEDURE GET_PERSONAL_DATA
BEGIN-SELECT
EMPLID
SSN
FNAME
LNAME
STREET1
STREET2
CITY
STATE
ZIP
FROM PS_PERSONAL_DATA WHERE EMPLID=$EMPLOYMENT.EMPLID
END-SELECT
END-PROCEDURE GET_PERSONAL_DATA

Thanks,
Lisa

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users