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...
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'...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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...
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.
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...
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. ???
Thanks jpadie. I was thinking this was what was going to be the answer. As far as looping through the $employees[] to find dups, is that a specific PHP function that I can read up on how to use. I am guessing that once I start loading in $B_rows (maybe not), I need to be checking at that...
I've got two databases, same schema structure, basically company A and company B. I can get the data I want from each individually but need to combine the results of identical queries then echo it out on the page, i.e an employee directory that list employees from both companies but all in one...
MSAccess 2003
I have a form with two listboxes. The user moves items from listbox1 to listbox2(target). I want to move all the items from the target listbox into a variable and use that variable as criteria in a select query. The variable would need to have OR between the values due to the...
Your correct about the other factor. Actually what I've found is that the revenue center is the second table(subreport data) is a different type of revenue center so it basically would not find a match to the revenue center on the main report. The two tables are linked by a charge(invoice)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.