[thelist] comparing form data to database data

Tab Alleman talleman at autobex.com
Fri Oct 27 10:29:50 CDT 2000

No, I think you got the point of my suggestion.

I don't know all the dynamics of your project, so maybe what I suggested
would cause fatal problems for other aspects of it, but just to do the small
bit of it that you described, I would simply put ALL the activities and ALL
the substitutes dates into the database, and do the date-checking during the
data-retrieval phase like I described.  With my approach, you have the
substitute's data whether you need it or not, and I often find that data is
much like toilet paper:  It's better to have it and not need it.  ;)

But if having that data in the database will screw up something else, then
forget it.  It also sounds like doing this would require changes to your
database structure, so it might be too late for that.

Hope this helps,

-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of David McCreath
Sent: Friday, October 27, 2000 10:31 AM
To: thelist at lists.evolt.org
Subject: RE: [thelist] comparing form data to database data

Hi, Tab --

> Do you *have* to verify the range before doing the insert?

I'm not sure I understand the direction you're going. My approach was to
make sure that the SubStartDate and SubEndDate are between the ActStartDate
and ActEndDate *before* they're inserted so I don't end up with bad data.

> Cause otherwise you can just insert everything into the database, and then
> do a:
> SELECT * FROM Table WHERE (SubstitutesStartDate BETWEEN ActivityStartDate
> AND ActivityEndDate) AND (SubstitutesEndDate BETWEEN ActivityStartDate AND
> ActivityEndDate)

I think maybe I didn't explain my task well enough, but later on in the
process, an activity summary is created by pulling all the related info
(including the subs) from a few tables based on the activity ID.

By checking the date ranges prior to insert, I don't have to check them when
I pull them back out.

Does that make sense? Or have I missed the point of your suggestion?


For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt !

More information about the thelist mailing list