SQL Server Trouble with "False" (1 Viewer)

jeo

Registered User.
Local time
Today, 14:54
Joined
Dec 26, 2002
Messages
299
I had 2 tables in regular MS Access originally. Eventually everything got moved to a SQL server and both of the tables now reside on the sql server.
I had a pretty tricky DCount() statement on one of my forms for a click button event:
If DCount("ProjectStaffID", "qryAvailableDatesCheck", "(((((Forms!frmProjectStaff!Start1 < Start1) And (Forms!frmProjectStaff!End1 < End1)) Or ((Forms!frmProjectStaff!Start1 > End1) And (Forms!frmProjectStaff!End1 > End1)))=False) AND (((Forms!frmProjectStaff!FTE1 + FTE1)) > 1) AND (StaffID=Forms!frmProjectStaff!Combo2))") > 0 And (ClientID <> 106) Then

The code worked great before I moved those 2 tables into sql, now it blows up and I assume it's because of my = False.
I tried using NOT and getting rid of false and then it doesn't blow up any more, it just doesn't produce the results i'm looking for.
any ideas what could be wrong and why and may be what i need to change?
thank you, any ideas and suggestions would be greatly apprecaited!
 

jeo

Registered User.
Local time
Today, 14:54
Joined
Dec 26, 2002
Messages
299
I think I need to clarify this.
I have a DCount() statement on my form for on-click event for a button.

If DCount("ProjectStaffID", "qryAvailableDatesCheck", "(((((Forms!frmProjectStaff!Start1 < qryStart1) And (Forms!frmProjectStaff!End1 < qryEnd1)) Or ((Forms!frmProjectStaff!Start1 > qryEnd1) And (Forms!frmProjectStaff!End1 > qryEnd1)))= 0)

after I put table for qryAvailableDatesCheck into SQL it seems like it's having difficulties reading date values in that query. When I step through my code I can see value for dates from the form, but date value from my qryAvailalbeDatesCheck - qryStart1 and qryEnd1 have no values in them at all, which makes this whole If statement incorrect, it's always a zero.
Do I need to assign date values from the query to a variable somehow?
I've been struggling with this for a while now:eek: :confused: , so I'm hoping that this clarification will help and someone will suggest something.
Thank you very much!
 

Users who are viewing this thread

Top Bottom