home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Programmer'…arterly (Limited Edition) / Visual_Basic_Programmers_Journal_VB-CD_Quarterly_Limited_Edition_1995.iso / code / ch06code / listings / 06list02.txt next >
Text File  |  1995-08-10  |  1KB  |  22 lines

  1. Listing 6.2[em]Creating a Variety of Calculated Fields with the SELECT Statement
  2. '***************************************
  3. 'Calculate the total price for the items
  4. '***************************************
  5. SELECT [Retail Items].Retail * Sales.Quantity FROM [Retail Items],Sales  _
  6.      WHERE Sales.[Item Code]=[Retail Items].[Item Code]
  7. '**********************************************************************
  8. 'Create a name field by concatenating the Lastname and Firstname fields
  9. '**********************************************************************
  10. SELECT Lastname & ', ' & Firstname FROM Customers
  11. '******************************************************************
  12. 'Create a customer ID using the first 3 letters of the Lastname and
  13. '  Firstname fields and make all letters upper case.
  14. '******************************************************************
  15. SELECT UCASE$(MID$(Lastname,1,3)) & UCASE$(MID$(Firstname,1,3)  _
  16.    FROM Customers
  17. '***************************************************************
  18. 'Determine the square root of a number for use in a data report.
  19. '***************************************************************
  20. SELECT Datapoint, SQR(Datapoint) FROM Labdata
  21.  
  22.