Jump to content


Photo

MSAccess Query Vs. MYSQL


  • Please log in to reply
2 replies to this topic

#1 SuperDaveCybtro

SuperDaveCybtro
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 01 September 2006 - 07:36 PM

Hello All.
I am trying to convert a query I have working fine in M$access to MySql. In access I have one table linked 4 times to allow me to compare 4 different date values to 4 different fields. This will let me check that all dates have valid data. If it passes this test I want it to append a record to my statuses table.

My Problem is that Though it works in Access Even converting it thus far it does not work in MYSQL. All it says is that the Query could not be executed.

I am not sure what other information you need but I will provide much as I can.


INSERT INTO tblstathist ( rqstid, userid, statusid )
SELECT tblrqst.RqstId, 1447, 8 
FROM tblperiod,
    tblperiod tblperiod_1,
    tblperiod tblperiod_2,
    tblperiod tblperiod_3,
    tblrqst,
    vewcurrentstat
WHERE vewcurrentstat.statusid = 4 AND
  tblperiod.PeriodBeginProcessing<=now() AND
  tblperiod_1.PeriodBeginProcessing<=now() AND
  tblperiod_2.PeriodBeginProcessing<=now() AND
  tblperiod_3.PeriodBeginProcessing<=now() AND
  tblperiod.PeriodDate = tblrqst.RqstP1Stop AND
  tblperiod_1.PeriodDate = tblrqst.RqstP2Start AND
  tblperiod_2.PeriodDate = tblrqst.RqstP1Start AND
  tblperiod_3.PeriodDate = tblrqst.RqstP2Stop AND
  tblrqst.RqstId = vewcurrentstat.rqstid;


#2 SuperDaveCybtro

SuperDaveCybtro
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 01 September 2006 - 08:44 PM

So the SQL turns out to actually work. I just verified it. But it is a royal hog. Is there a better way to check these values, then what I am doing?

#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 02 September 2006 - 03:47 PM

Not really... you have to check them all, don't you?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users