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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by Apollo6

  1. Apollo6

    Sorting results of array a second time before output?

    The below is the final version of the SQL statement. I actually got the syntax answered in another forum. "SELECT substring(convert(birthdate, sql_char),7,2), lastname, altaddr1, altaddr2, altaddr4, altcntry, birthdate FROM SOINC.UPEMPL where status <> 3 AND substring(convert(birthdate...
  2. Apollo6

    Help with correct SQL syntax using CONVERT?

    Thanks for the help... This is the final statement that I got to work... "SELECT substring(convert(birthdate, sql_char),7,2), lastname, altaddr1, altaddr2, altaddr4, altcntry, birthdate FROM SOINC.UPEMPL where status <> 3 AND substring(convert(birthdate, sql_char),5,2) = '$whatMonth'...
  3. Apollo6

    Help with correct SQL syntax using CONVERT?

    Mirtheil- I tried attempting to execute the SQL in the PCC but still get the exact same SQL error... I did determine by looking at the table design that the field [birthdate] is a 'decimal' type. That being said, how can I write the SQL statement to pull out just records where birthdate = 03...
  4. Apollo6

    Help with correct SQL syntax using CONVERT?

    From executing the version stuff, it states v8.60, I guess I was expecting something about the database itself, i.e. 2000i or something like that. I read some post that said CAST would not work with this but since I'm not using that, shouldn't be the issue. I used the syntax you stated and...
  5. Apollo6

    Help with correct SQL syntax using CONVERT?

    1. Could you help me in determining exactly which version of the database I am running on? I can see that I am running the Control Cener version 8.6; how can I determine the exact database version I am on? 2/3. Warning: SQL error: [Pervasive][ODBC Client Interface][Pervasive][ODBC Engine...
  6. Apollo6

    Help with correct SQL syntax using CONVERT?

    In my database I have a birthdate field, type decimal. Example of a record would be 19721003, i.e. 10/03/1972. I am using the following syntax where $whatMonth = '10'. Ulitmately, I want to pull out all the records with a birthday in a specific month, then order them by day: SELECT lastname...
  7. Apollo6

    Sorting results of array a second time before output?

    I tried the following and it barked as well, was this what you were thinking? "SELECT lastname, altaddr1, altaddr2, altaddr4, altcntry, birthdate FROM TOPLLC.UPEMPL where status <> 3 And date(month(birthdate)) = '$month'"; I'm hoping to find some SQL sytax that is PervaseSQL specific and allow...
  8. Apollo6

    Sorting results of array a second time before output?

    jpadie- "SELECT lastname, altaddr1, altaddr2, altaddr4, altcntry, birthdate FROM TOPLLC.UPEMPL where status <> 3 And month(birthdate) = '$month'"; I get Incompatible Types in Expression syntax error. I would assume this is do to the birthdate field is actually text and I'm applying a date...
  9. Apollo6

    Sorting results of array a second time before output?

    Both... I completely agree with the fact that I should get the SQL statement to get exactly what I want then work with that recordset. The problem is, I have not be able to determine the correct syntax, if possible, to return just the data I want. For example: $query_A = "SELECT lastname...
  10. Apollo6

    Sorting results of array a second time before output?

    I have a list of employees with birthdate as one of the fields. This field comes from the database as a string, i.e. 19721003 for 10/03/1972. The initial query pulls all employees. I then have the code working to pull just employees for a specific month. I do this by pulling out the month...
  11. Apollo6

    How to create a single recordset/array from two results?

    Itshim... Going from your idea, the following worked. $query = "SELECT DISTINCT altaddr2 FROM companyA.UPEMPL UNION SELECT DISTINCT altaddr2 FROM companyB.UPEMPL"; $result = odbc_exec($connect_companyA, $query); $rows = odbc_fetch_row($result); I still don't quite understand how it...
  12. Apollo6

    How to create a single recordset/array from two results?

    Actually, with PervasiveSQL, it is much like MSSQL, it has a Manager that you can have multiple databases on the same server. In my case, both databases live on the same server. I have done UNION queries plenty but within the same database so I am not sure it can be done across two databases...
  13. Apollo6

    How to create a single recordset/array from two results?

    jpadie... Good info, I will try and post back. Also interested in the UNION approach as it would seem to be more efficient, a single execution to get the dataset to work with.
  14. Apollo6

    How to create a single recordset/array from two results?

    sleipnir214... Sorry about that, I am going against a PervasiveSQL database. From what I've Googled, it appears to support UNION queries. Again, I just don't understand how the syntax would be. Would it be something like: $query = "SELECT employee_name FROM companyA.UPEMPL UNION SELECT...
  15. Apollo6

    How to create a single recordset/array from two results?

    sleipner214... I thought about this but couldn't get the syntax to work, specifically when you call odbc_exec. I need to execute against both databases. ???

Part and Inventory Search

Back
Top