Monday, March 26, 2012
Memo Field Comparison
I recieve input from the user via a PHP form.
I have to match that input to the contents fo the memo field.
No matter what I do I receive errors like
1. Cannot compare VARCHAR
2.Warning: SQL error: [MERANT][ODBC SQLBase driver][SQLBase]00979 PRS PSR Plus sign required for outer join, SQL state 37000 in SQLExecDirect in F:\www\Apache2\htdocs\include\func_db.inc on line 25
generated by this code:
$bits_search_string = trim($bits_search_string);
$sql = "SELECT P.ID, P.DESCRIPTION"
. " FROM PART P, PART_BINARY PB"
. " WHERE P.ID = PB.PART_ID "
. " AND CONTAINS(PB.BITS, '$bits_search_string')";
or the latest
3.Warning: SQL error: [Microsoft][ODBC Cursor Library] Positioned request cannot be performed because result set was generated by a join condition, SQL state SL002 in SQLGetData in F:\www\Apache2\htdocs\include\func_db.inc on line 42
generated by this code:
$bits_search_string = trim($bits_search_string);
$sql = "SELECT P.ID, P.DESCRIPTION, PB.BITS"
. " FROM PART P, PART_BINARY PB"
. " WHERE P.ID = PB.PART_ID ";
$vdb->query($sql);
while ($row = $vdb->getRow(true)){
$memo = $row['PB.BITS'];
Where PB.BITS is the retarded memo field.
I can not change the database to have the field as text, there are
legacy applications dependent upon it.
I would appreciate any insight on how the memo field is structured.
What can I do to manipulate it. I can use PHP or JSP to create this
function. Those are the limitations.
Thank you very much,
I appreciate any feedback.There are a lot of usefull string functions that cannot be used on text (memo) fields, but you can use the CAST or CONVERT functions within your sql query to treat the fields as varchar datatypes. The disadvantage is that you can't index them.
blindman
Monday, February 20, 2012
MDX Help - Should be easy
I want to have a calculation that rolls up monthly closed sales and displays the total month volume no matter what dimension levels have been added.
Example:
Month Store # Sales Total Monthly Sales
April 1 10,000 50,000
April 2 10,000 50,000
April 3 30,000 50,000
May 1 20,000 70,000
May 2 20,000 70,000
May 3 30,000 70,000
This could be across multiple dimensions (ie, I could add product type, business day number, etc) and I would still want the total monthly sales to be the sum of all sales for the month for the entire company.
I have tried several things, but I do not know enough about MDX to know where to look.
Thanks for your help!!
Bob
I think this is what you are looking for:
with member [Measures].[Total Month Sales] as '([Time].currentmember, [Store].[All Stores], [Measures].[Unit Sales])'
select
{[Measures].[Unit Sales],[Measures].[Total Month Sales]} on columns,
{nonemptycrossjoin({descendants([Time].[1997],[Time].[Month])},{[Store].[Store Name].members})} on rows
from Sales
The trick is to add all the 'All' members to [Measures].[Total Month Sales]. For instance, if you have a product dimension, it should be
'([Time].currentmember, [Store].[All Stores], [Product].[All Product], [Measures].[Unit Sales])'
Hope this helps,
Santi
|||AWESOME! Thanks for your quick answer!!
BobP