# Example: Define age categories for the animals

 bet 10/19 Sana 14.08.2018 Hajmi 466 b.

## Example: Define age categories for the animals.

• Less than 3 months
• Between 3 months and 9 months
• Between 9 months and 1 year
• Over 1 year

• ## Categorize by Days Late

• 30, 90, 120+

• ## Note the use of the Select and Where conditions.

• Synatx is the same--only learn it once.
• You can also use subqueries.

• ## Change the ListPrice of Animals at the PetStore.

• For cats, increase the ListPrice by 10%.
• For dogs, increase the ListPrice by 20%.

• ## Test each query.

• Check the SQL.
• Look at the data.
• Check computations
• ## Combine into subqueries.

• Use cut-and-paste to avoid errors.
• Check for correlated subqueries.
• ## Test sample data.

• Identify different cases.
• Check final query and subqueries.
• Verify calculations.

• ## Integer

• 2 bytes
• -32768 32767
• ## Long

• 4 bytes
• +/- 2,147,483,648
• ## Single

• 4 bytes
• +/- 3.402823 E 38
• +/- 1.401298 E-45

• ## Scope

• Where is the variable, and which procedures can access it?

• ## Wider scope and lifetime

• Created at a higher level
• Form
• Public module
• Accessible to any procedure in that form or module.
• Declare it Global to make it available to any procedure.

• ## Standard Math

• + - * /
• \ Integer divide
• ^ Exponentiation
• (2^3 = 2*2*2 = 8)
• Mod
• (15 Mod 4 = 3) (12 + 3 = 15)

• ## Numeric

• Exp, Log
• Atn, Cos, Sin, Tan
• Sqr
• Abs
• Sgn
• Int, Fix
• Rnd, Randomize

• ## DateAdd, DateDiff

• “y”, “m”, “q” . . .
• Firstweekday
• 1=Sunday,. . .
• Can also be used to find number of Fridays, between two dates.

• IsDate
• IsNumeric
• VarType
• IsEmpty
• IsNull

• Message
• Type
• Title
• ## Types: Use Constants

• vbOKOnly vbOKCancel
• vbAbortRetryIgnore
• vbYesNoCancel
• vbYesNo vbRetryCancel

• Do'stlaringiz bilan baham:

Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2019
ma'muriyatiga murojaat qiling