mysql

Hello

I have just upgraded mysql from 4.0.x to 4.1.18 the below used to work on the old database but not the new one. Is there anything wrong with it?

I have alos ran it in phpmyadmin. gives me no errors but shows no results.

SELECT SUM(sales_table.Rebate) AS Rebate, sales_table.MemberID, user_table_cash.fname, user_table_cash.username, user_table_cash.password, user_table_cash.lname, user_table_cash.add1, user_table_cash.town, user_table_cash.county, user_table_cash.postcode, user_table_cash.payee, user_table_cash.email
FROM sales_table, user_table_cash
WHERE
user_table_cash.userid=sales_table.MemberID
AND
sales_table.DeleteFlag NOT IN (1,2,3,'TRUE','true')
AND
sales_table.CreateDate < '2006-02-01'
GROUP BY
sales_table.MemberID
submissiontechnologyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Joseph MelnickSenior Software Developer - Pharmacy ApplicationsCommented:
Hello submissiontechnology,

if the new database has been installed and the data imported check that you can select individual records from each table.

Next check that user_table_cash.userid=sales_table.MemberID syncs up.

select a.MemberID from sales_table a,   user_table_cash b where  b.userid=a.MemberID;

This will show you the MemberID's that have rows in each table.
You can further refine your query to see which part of your where clause is false and not joining tables

It may be that sales_table has had no data added prior to 2006-02-01
OR
The deleteflag is set to 1,2,3, TRUE or true

Joseph Melnick  (jmelnick)







Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TeRReFCommented:
What type is the sales_table.CreateDate column? If it is datetime, you could try to change '2006-02-01' into 20060201 (NO quotes)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.