[thelist] comparing form data to database data

David McCreath mccreath at ak.net
Fri Oct 27 09:36:48 CDT 2000


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?

Dave





More information about the thelist mailing list