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 >
Wrap
Text File
|
1995-08-10
|
1KB
|
22 lines
Listing 6.2[em]Creating a Variety of Calculated Fields with the SELECT Statement
'***************************************
'Calculate the total price for the items
'***************************************
SELECT [Retail Items].Retail * Sales.Quantity FROM [Retail Items],Sales _
WHERE Sales.[Item Code]=[Retail Items].[Item Code]
'**********************************************************************
'Create a name field by concatenating the Lastname and Firstname fields
'**********************************************************************
SELECT Lastname & ', ' & Firstname FROM Customers
'******************************************************************
'Create a customer ID using the first 3 letters of the Lastname and
' Firstname fields and make all letters upper case.
'******************************************************************
SELECT UCASE$(MID$(Lastname,1,3)) & UCASE$(MID$(Firstname,1,3) _
FROM Customers
'***************************************************************
'Determine the square root of a number for use in a data report.
'***************************************************************
SELECT Datapoint, SQR(Datapoint) FROM Labdata