CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 SQL Func Syntax

Print topic Send  topic

Author Message
Tang

Posts: 14
Posted: 08/05/2004, 10:40 AM

I need help with getting the logic and syntax correct with this function and validation expression. This post is in reference to an earliy post that was very vague. I've written the code now and am wondering how to finish to section of my project up.

This is the function, that I'm assuming I should put in the events file?:
Function Total_TITLE_CD()  
Dim fSTART_DATE  
Dim fEND_DATE  
Dim fTITLE_CD  
  
Set Connection = DBOCM_db  
Connection.Open  
  
fSTART_DATE = TBL_DEPLOYED.START_DATE.Value  
fEND_DATE = TBL_DEPLOYED.END_DATE.Value  
fTITLE_CD = TBL_DEPLOYED.TITLE_CD.Value  
  
SQL = "COUNT TBL_DEPLOYED.TITLE_CD"  
FROM "TBL_DEPLOYED"  
WHERE ("TBL_DEPLOYED.TITLE_CD" = " & fTITLE_CD & ") AND ("TBL_DEPLOYED.START_DATE">= " & fSTART_DATE &   
") AND ("TBL_DEPLOYED.END_DATE"<=" & fEND_DATE & ")  
  
End Function

And this is the Validation expression at the "Before Insert" location:
If Total_TITLE_CD() > 5 Then  
TBL_DEPLOYED.Errors.addError("Too many personnel for that title code have already scheduled for those   
  
dates")  
End if 

The query within the func should produce a total number for the number of employes scheduled for the dates within the form, based on the personnels' title_cd.

The Validation expression should only allow inserting the new record only if there are less than 5 people with that title code scheduled.

I'm really reaching with writing code and I desperately need help.
Thanks, Tang
View profile  Send private message
Tang

Posts: 14
Posted: 08/10/2004, 8:06 AM

Bump.

Anyone?
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.