SuperDaveCybtro Posted September 1, 2006 Share Posted September 1, 2006 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. [code]INSERT INTO tblstathist ( rqstid, userid, statusid )SELECT tblrqst.RqstId, 1447, 8 FROM tblperiod, tblperiod tblperiod_1, tblperiod tblperiod_2, tblperiod tblperiod_3, tblrqst, vewcurrentstatWHERE 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;[/code] Quote Link to comment Share on other sites More sharing options...
SuperDaveCybtro Posted September 1, 2006 Author Share Posted September 1, 2006 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? Quote Link to comment Share on other sites More sharing options...
fenway Posted September 2, 2006 Share Posted September 2, 2006 Not really... you have to check them all, don't you? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.