Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Insert new records
Message
 
 
À
22/08/2001 17:21:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00547655
Message ID:
00547691
Vues:
8
This message has been marked as the solution to the initial question of the thread.
You can use the following select statement
ldDate = DATE()

ldYearBeg = DATE( YEAR(ldDate),01, 01)
ldYearEnd = DATE( YEAR(ldDate)+1,01, 01)-1

SELECT * ;
	FROM  receivables ;
	WHERE Programcode = lcProgramcode ;
		AND receivables.TranDate Between ldYearBeg AND ldYearEnd ;
	TO SCREEN NOCONSOLE
	
IF _TALLY > 0
	*There is at least one record for this year
ELSE
	*No records for this year
ENDIF		
>I have a receivables table that I want to add information too but can't figure out how to do it. Here are the rules to adding to it. I have customers who are either billed annually or monthly. They have a program code. It is marked in the program table as either monthly or annually.
>
>I want it to work so that when the user hits a button it will add a record for the annual customers only if they aren't in the receivables table within the past year and add the monthly people in once a month. I have it set up so that the user can only do it once a month as it is. It takes a look at the last date in the receivables table and compares it to the month of the date. If there is match you can't click the button till next month. I'm just having a problem getting the annual people to work. Any ideas?
>
>TIA,
>Tyler
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform