AIN102D Access date functions sample queries

827 views

Published on

Example queries of every date function in Microsoft Access.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
827
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

AIN102D Access date functions sample queries

  1. 1. AIN102 Access Query Design Samples Module – Date Functions P.O. Box 6142 Laguna Niguel, CA 92607 949-489-1472 http://www.d2associates.com [email_address]
  2. 2. AIN102 <ul><li>Session 1 – Review of Relational Databases and Single Table Retrieval, Functions and Operators </li></ul><ul><li>Session 2 – Multi-table retrieval, Sub queries, Unions, Action Queries, Indexes </li></ul><ul><li>Bonus Modules – Sample Date and String Functions </li></ul>Admissions AIN102 Module 1
  3. 3. AIN102 <ul><li>Lecture/discussion with demonstrations </li></ul><ul><ul><li>Mostly practical, but a dose of “theory” </li></ul></ul><ul><li>Assumes some familiarity with MS Access </li></ul><ul><li>Hands-on </li></ul><ul><li>Exercises (Mostly cumulative) </li></ul><ul><li>About 3 hours per module </li></ul><ul><li>Frequent breaks </li></ul>Admissions AIN102 Module 1
  4. 4. Microsoft Access Query Design <ul><li>Focus of this class will be on the Query Designer, with SQL used from time-to-time to explain concepts </li></ul><ul><li>Queries are widely used for: </li></ul><ul><ul><li>Database administration </li></ul></ul><ul><ul><li>Enterprise application development </li></ul></ul><ul><ul><li>Data driven web sites </li></ul></ul><ul><ul><li>Retrieving and modifying data in MS Access databases </li></ul></ul><ul><li>A foundation skill for eBusiness and almost all major business applications that use relational databases </li></ul>Admissions AIN102 Module 1
  5. 5. Access Query Design and SQL <ul><li>The SQL engine Access uses is called JET </li></ul><ul><li>It support both MS Access and Visual Basic </li></ul><ul><li>Looking “behind the scenes” at your queries in SQL can be helpful and we will do this; however SQL is not necessary except for UNION queries </li></ul>Admissions AIN102 Module 1
  6. 6. Relational Database Basics <ul><li>Storage </li></ul><ul><li>Databases </li></ul><ul><li>Tables </li></ul><ul><li>Rows </li></ul><ul><li>Columns </li></ul><ul><li>Indexes </li></ul><ul><li>Views </li></ul><ul><li>SQL interface </li></ul>Admissions AIN102 Module 1
  7. 7. Storage <ul><li>In Access one file with extension mdb. I.e mydatabase.mdb . </li></ul><ul><li>Database splitter can be used to split it into two parts – a front end and a back end. </li></ul><ul><li>Interface to physical storage via the “JET” database engine. This is the behind-the scenes-workhorse. </li></ul>Admissions AIN102 Module 1
  8. 8. Databases <ul><li>In the Access world refers to all objects stored in the mdb. </li></ul><ul><ul><li>Tables </li></ul></ul><ul><ul><li>Queries </li></ul></ul><ul><ul><li>From </li></ul></ul><ul><ul><li>Reports </li></ul></ul><ul><ul><li>Macros </li></ul></ul><ul><ul><li>Code modules </li></ul></ul>Admissions AIN102 Module 1
  9. 9. Admissions AIN102 Module 1 Relational Database Table
  10. 10. Admissions AIN102 Module 1 Sample Access Database
  11. 11. Admissions AIN102 Module 1 Database Relationships
  12. 12. Approaching Query Design <ul><li>Try to build queries a step at a time </li></ul><ul><li>Save existing queries that are working as you like; modify them with a new name when building a modified query </li></ul><ul><li>Try looking at the generated SQL code from time-to-time </li></ul>Admissions AIN102 Module 1
  13. 13. Sample Database <ul><li>Before we continue… </li></ul><ul><li>Load the sample database if you haven’t already </li></ul>Admissions AIN102 Module 1
  14. 14. Query Designer Admissions AIN102 Module 1 Right click anywhere for SQL View Double click or drag to add a field Double click to add a table
  15. 15. Date Functions <ul><li>The Date functions include </li></ul><ul><li>- Date() </li></ul><ul><li>- DateAdd() </li></ul><ul><li>- DateDiff() </li></ul><ul><li>- DatePart() </li></ul><ul><li>- etc. </li></ul>Admissions AIN102 Module 1
  16. 16. Date Functions (Cont’d) <ul><li>The Date functions include </li></ul><ul><ul><li>Month() </li></ul></ul><ul><ul><li>Year() </li></ul></ul><ul><ul><li>Etc. </li></ul></ul>Admissions AIN102 Module 1
  17. 17. Date() <ul><li>This function returns the current system date. </li></ul><ul><li>Create a sample query and save as qrySample_Date. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Type Current Date: Date() in field. Save. </li></ul>Admissions AIN102 Module 1
  18. 18. Add Table Admissions AIN102 Module 1 Doubl click Admissions to add
  19. 19. Result Admissions AIN102 Module 1 Current System Date
  20. 20. DateAdd() <ul><li>Syntax : DateAdd(interval, number, date) </li></ul><ul><li>- interval: string expression that is the interval of time you want to add. </li></ul><ul><li>- number: numeric expression that is the number of interval you want add. </li></ul><ul><li>- date: date to which the interval is added. </li></ul>Admissions AIN102 Module 1 yyyy - Year q - Quarter m- Month y - Year d - Day w -Weekday ww - Week h - Hours n - Minutes s - second
  21. 21. DateAdd() <ul><li>Create a query and save as qrySample_DateAdd1. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: After 5 Years: DateAdd (&quot;yyyy&quot;, 5,Admissions.Admit_Date). Save. </li></ul><ul><li>This will add 5 years to the Admit Date. </li></ul>Admissions AIN102 Module 1
  22. 22. DateAdd() Admissions AIN102 Module 1
  23. 23. Result Admissions AIN102 Module 1 Admit Date After 5 Years
  24. 24. DateAdd() <ul><li>Create a query and save as qrySample_DateAdd2. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: DateAdd(“m”,3,Admissions.Admit_Date) as [After 3 Months]. Save. </li></ul><ul><li>This will add 3 months to the Admit Date. </li></ul>Admissions AIN102 Module 1
  25. 25. DateAdd() Admissions AIN102 Module 1
  26. 26. DateAdd() Admissions AIN102 Module 1 Admit Date After 3 Months
  27. 27. DateDiff() <ul><li>Syntax: DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]]) </li></ul><ul><li>- interval: string expression that is the interval of time you use to calculate the difference between date1 and date2. </li></ul><ul><li>- date1, date2: two dates you want to use in the calculation. </li></ul><ul><li>- firstdayofweek(optional): A constant that specifies the first day if the week. If not specified, Sunday is assumed. </li></ul><ul><li>- firstweekofyear(optional): A constant the first week of the year. If not specified, the first week is assumed to be the week in which January 1 occurs. </li></ul>Admissions AIN102 Module 1
  28. 28. DateDiff() <ul><li>Create a query and save as qrySample_DateDiff. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date, Dischg_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: DateDiff(&quot;d&quot;, Admissions.Admit_Date, Admissions.Dischg_Date) as [Date Difference] . Save. </li></ul><ul><li>This will show the difference between Admit Date and Discharge Date. </li></ul>Admissions AIN102 Module 1
  29. 29. DateDiff() Admissions AIN102 Module 1
  30. 30. DateDiff() Admissions AIN102 Module 1 Difference Between Admit and Discharge Date
  31. 31. DatePart() <ul><li>Syntax: DatePart(interval, date[, firstdayofweek[,firstweekofyear]]) </li></ul><ul><li> - interval: string expression that is the interval of time you want to return. . </li></ul><ul><li>- date: Variant (Date) value that you want to evaluate. </li></ul><ul><li>- firstdayofweek(optional): A constant that specifies the first day if the week. If not specified, Sunday is assumed. </li></ul><ul><li>- firstweekofyear(optional): A constant the first week of the year. If not specified, the first week is assumed to be the week in which January 1 occurs. </li></ul>Admissions AIN102 Module 1
  32. 32. DatePart() <ul><li>Create a query and save as qrySample_DatePart1. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: DatePart(&quot;m&quot;, Admissions.Admit_Date) as [Month Of Admission Date] . Save. </li></ul><ul><li>This will show the month of the Admit Date. </li></ul>Admissions AIN102 Module 1
  33. 33. DatePart() Admissions AIN102 Module 1
  34. 34. Result Admissions AIN102 Module 1 Month of Admit Date
  35. 35. DatePart() <ul><li>Create a query and save as qrySample_DatePart2. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: DatePart(“yyyy&quot;, Admissions.Admit_Date) as [Year Of Admission Date] . Save. </li></ul><ul><li>This will show the year of the Admit Date. </li></ul>Admissions AIN102 Module 1
  36. 36. Result Admissions AIN102 Module 1 Year of Admit Date
  37. 37. DateSerial() <ul><li>Returns a Variant (Date) for a specified year, month, and day. </li></ul><ul><li>Syntax: DateSerial(year, month, day) </li></ul><ul><li>- year: Number between 100 and 9999, inclusive, or a numeric expression. </li></ul><ul><li>- month Integer. Any numeric expression. </li></ul><ul><li>- day: Integer. Any numeric expression. </li></ul>Admissions AIN102 Module 1
  38. 38. DateSerial() <ul><li>Create a query and save as qrySample_DateSerial. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: DatePart(&quot;yyyy&quot;, Admissions.Admit_Date) as [Year Of Admission Date] . Save. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: ], DateSerial( DatePart(&quot;yyyy&quot;, Admissions.Admit_Date), 12, 31) as [Last Date Of Year] . Save. </li></ul><ul><li>This will show the last date of respective year of the Admit Date. </li></ul>Admissions AIN102 Module 1
  39. 39. DateSerial() Admissions AIN102 Module 1
  40. 40. Result Admissions AIN102 Module 1 Last Date of Admit Year
  41. 41. DateValue() <ul><li>Returns a Variant (Date). </li></ul><ul><li>Syntax: DateValue(date) </li></ul><ul><li>- date: Generally it is a string expression representing date and it should be separated by valid date separator. </li></ul>Admissions AIN102 Module 1
  42. 42. DateValue() <ul><li>Create a query and save as qrySample_DateValue1 </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: DateValue(&quot;February 12, 2003&quot;) As [Date Value] . Save. </li></ul><ul><li>This will show “2/12/2003” in the Date Value column. </li></ul>Admissions AIN102 Module 1
  43. 43. DateValue() Admissions AIN102 Module 1
  44. 44. Result() Admissions AIN102 Module 1 Date Value
  45. 45. DateValue() <ul><li>Create a query and save as qrySample_DateValue2 </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: DateValue(&quot;February 12&quot;) As [Date Value] . Save. </li></ul><ul><li>This will show “2/12/2007” in the Date Value column i.e. it will consider the current system year. </li></ul>Admissions AIN102 Module 1
  46. 46. Result() Admissions AIN102 Module 1 Date Value
  47. 47. Day() <ul><li>Returns a Variant (Integer) specifying a whole number between 1 and 31, inclusive, representing the day of the month. </li></ul><ul><li>Syntax: Day(date) </li></ul><ul><li>- date: Generally it is a variant, numeric expression, string expression representing date. </li></ul>Admissions AIN102 Module 1
  48. 48. Day() <ul><li>Create a query and save as qrySample_Day1. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: Day(Admissions.Admit_Date) AS [Day] . Save. </li></ul><ul><li>This will show the day of Admit Date. </li></ul>Admissions AIN102 Module 1
  49. 49. Day() Admissions AIN102 Module 1
  50. 50. Result Admissions AIN102 Module 1 Day
  51. 51. Day() <ul><li>Create a query and save as qrySample_Day2. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: Day: Day(Admissions.Admit_Date) . </li></ul><ul><li>Type 1 in Criteria. Save. </li></ul><ul><li>This will show those many records whose day of Admit Date is “1”. </li></ul>Admissions AIN102 Module 1
  52. 52. Result Admissions AIN102 Module 1 (Day = 1)
  53. 53. Month() <ul><li>Returns a Variant (Integer) specifying a whole number between 1 and 12, inclusive, representing the day of the month. </li></ul><ul><li>Syntax: Month(date) </li></ul><ul><li>- date: Generally it is a variant, numeric expression, string expression representing date. </li></ul>Admissions AIN102 Module 1
  54. 54. Month() <ul><li>Create a query and save as qrySample_Month1. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: Month(Admissions.Admit_Date) AS [Month] . Save . </li></ul><ul><li>This will show the month of Admit Date. </li></ul>Admissions AIN102 Module 1
  55. 55. Month() Admissions AIN102 Module 1
  56. 56. Result() Admissions AIN102 Module 1 Month
  57. 57. Month() <ul><li>Create a query and save as qrySample_Month1. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: Month(Admissions.Admit_Date) AS [Month] . </li></ul><ul><li>Type 10 in Criteria. Save. </li></ul><ul><li>This will show those many records whose month of Admit Date is “10”. </li></ul>Admissions AIN102 Module 1
  58. 58. Result Admissions AIN102 Module 1 Month=10
  59. 59. Year() <ul><li>Returns a Variant (Integer) specifying a whole number. </li></ul><ul><li>Syntax: Year(date) </li></ul><ul><li>- date: Generally it is a variant, numeric expression, string expression representing date. </li></ul>Admissions AIN102 Module 1
  60. 60. Year() <ul><li>Create a query and save as qrySample_Year1. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: Year(Admissions.Admit_Date) AS [Year] . Save. </li></ul><ul><li>This will show the year of Admit Date. </li></ul>Admissions AIN102 Module 1
  61. 61. Year() Admissions AIN102 Module 1
  62. 62. Result() Admissions AIN102 Module 1 Year
  63. 63. Year() <ul><li>Create a query and save as qrySample_Year2. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: Year(Admissions.Admit_Date) AS [Year] . </li></ul><ul><li>Type 2001 in Criteria. Save. </li></ul><ul><li>This will show those many records whose year of Admit Date is “2001”. </li></ul>Admissions AIN102 Module 1
  64. 64. Result Admissions AIN102 Module 1 Year=2001
  65. 65. WeekDay() <ul><li>Returns a Variant(Integer) containing a whole number representing the day of the week. </li></ul><ul><li>Syntax: WeekDay(date[, firstdayofweek]) </li></ul><ul><li> - date: Variant, numeric expression, string expression, or any combination, that can represent a date. </li></ul><ul><li> - firstdayofweek (optional): A constant that specifies the first day if the week. If not specified, Sunday is assumed. </li></ul>Admissions AIN102 Module 1 firstdayofweek: 0 - API setting 1 - Sunday 2 - Monday 3 - Tuesday 4 - Wednesday 5 - Thursday 6 - Friday 7 - Saturday
  66. 66. WeekDay() <ul><li>Create a query and save as qrySample_WeekDay1. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: WeekDay(Admissions.Admit_Date) AS [Week Day] . Save. </li></ul><ul><li>This will show the week day of Admit Date. </li></ul>Admissions AIN102 Module 1
  67. 67. WeekDay() Admissions AIN102 Module 1
  68. 68. Result Admissions AIN102 Module 1 Week Day
  69. 69. WeekDay() <ul><li>Create a query and save as qrySample_WeekDay2. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: WeekDay(Admissions.Admit_Date, 2) AS [Week Day] . Save. </li></ul><ul><li>This will set the first day of the week to Monday(2) and show the week day of Admit Date. </li></ul>Admissions AIN102 Module 1
  70. 70. Result Admissions AIN102 Module 1 Week Day
  71. 71. WeekDayName() <ul><li>Returns a string indicating the specified day of the week. </li></ul><ul><li>Syntax: WeekDayName(weekday[, abbreviate[, firstdayofweek]]) </li></ul><ul><li> - weekday: The numeric designation for the day of the week. Numeric value of each day depends on setting of the firstdayofweek setting. </li></ul><ul><li>- abbreviate(optional): Boolean value that indicates if the weekday name is to be abbreviated. Default False( Not abbreviated). </li></ul><ul><li> - firstdayofweek(optional): A constant that specifies the first day if the week. If not specified, Sunday is assumed. </li></ul>Admissions AIN102 Module 1
  72. 72. WeekDayName() <ul><li>Create a query and save as qrySample_WeekDayName1. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: WeekDayName (WeekDay(Admissions. Admit_Date)) AS [Week Day Name] . Save. </li></ul><ul><li>This will show the week day name of Admit Date. </li></ul>Admissions AIN102 Module 1
  73. 73. WeekDayName() Admissions AIN102 Module 1
  74. 74. Result Admissions AIN102 Module 1 Week Day Name
  75. 75. WeekDayName() <ul><li>Create a query and save as qrySample_WeekDayName2. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: WeekDayName (WeekDay(Admissions. Admit_Date),True) AS [Week Day Name] . Save. </li></ul><ul><li>This will show the abbreviated week day name of Admit Date. </li></ul>Admissions AIN102 Module 1
  76. 76. Result Admissions AIN102 Module 1 Abbreviated Week Day Name
  77. 77. MonthName() <ul><li>Returns a string indicating the specified month. </li></ul><ul><li>Syntax: MonthName( month [, abbreviate ]) </li></ul><ul><li> - month: The numeric designation of the month. For example, January is 1, February is 2, and so on. </li></ul><ul><li>- abbreviate(optional): Boolean value that indicates if the weekday name is to be abbreviated. Default False( Not abbreviated). </li></ul>Admissions AIN102 Module 1
  78. 78. MonthName() <ul><li>Create a query and save as qrySample_MonthName. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: Monthname (Month(Admissions. Admit_Date)) as [Month Name] . Save. </li></ul><ul><li>This will show the month name of Admit Date. </li></ul>Admissions AIN102 Module 1
  79. 79. MonthName() Admissions AIN102 Module 1
  80. 80. Result Admissions AIN102 Module 1 MonthName
  81. 81. Now() <ul><li>Returns a Variant (Date) specifying the current date and time according your computer's system date and time. </li></ul><ul><li>Syntax: Now </li></ul><ul><li>Create a sample query and save as qrySample_Now. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Build [Now]: Now() in field. Save. </li></ul><ul><li>This will show the current system date and time. </li></ul>Admissions AIN102 Module 1
  82. 82. Now() Admissions AIN102 Module 1
  83. 83. Result Admissions AIN102 Module 1 Current System Date and Time
  84. 84. Hour() <ul><li>Returns a Variant (Integer) specifying a whole number between 0 and 23, inclusive, representing the hour of the day. </li></ul><ul><li>Syntax: Hour(time) </li></ul><ul><li>- time: Time is any Variant, numeric expression, string expression, or any combination, that can represent a time. </li></ul>Admissions AIN102 Module 1
  85. 85. Minute() <ul><li>Returns a Variant (Integer) specifying a whole number between 0 and 59, inclusive, representing the minute of the hour. </li></ul><ul><li>Syntax: Minute(time) </li></ul><ul><li>- time: Time is any Variant, numeric expression, string expression, or any combination, that can represent a time. </li></ul>Admissions AIN102 Module 1
  86. 86. Second() <ul><li>Returns a Variant ( Integer ) specifying a whole number between 0 and 59, inclusive, representing the second of the minute. </li></ul><ul><li>Syntax: Second(time) </li></ul><ul><li>- time: Time is any Variant, numeric expression, string expression, or any combination, that can represent a time. </li></ul>Admissions AIN102 Module 1
  87. 87. Hour(), Minute() and Second() <ul><li>Create a query and save as qrySample_Hour_Minute_Second. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Select AdmitNo and Admit_Date. </li></ul><ul><li>Right click on field and click on Build. </li></ul><ul><li>Build: Now as [Now], Hour(now) as [Hour], Minute(Now) as [Minute], Second(Now) As [Second] . Save. </li></ul><ul><li>This will show the hour, minute and second of current system date and time. </li></ul>Admissions AIN102 Module 1
  88. 88. Result Admissions AIN102 Module 1
  89. 89. Time() <ul><li>Returns a Variant (Date) indicating the current system time. </li></ul><ul><li>Syntax: Time </li></ul><ul><li>Create a sample query and save as qrySample_Time. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Build: [Now] as [Now], Time() as [Time] in field. Save. </li></ul><ul><li>This will show the current system time. </li></ul>Admissions AIN102 Module 1
  90. 90. Time() Admissions AIN102 Module 1
  91. 91. TimeSerial() <ul><li>Returns a Variant (Date) containing the time for a specific hour, minute, and second. </li></ul><ul><li>Syntax: TimeSerial( hour, minute, second ) </li></ul><ul><li>- hour: Variant (Integer). Number between 0 (12:00 A.M.) and 23 (11:00 P.M.), inclusive, or a numeric expression. </li></ul><ul><li>- minute: Variant (Integer). Any numeric expression. </li></ul><ul><li>- second Required; Variant (Integer). Any numeric expression. </li></ul>Admissions AIN102 Module 1
  92. 92. TimeSerial() <ul><li>Create a sample query and save as qrySample_TimeSerial. </li></ul><ul><li>Now add Admissions table. </li></ul><ul><li>Build: TimeSerial (5,15,12) as [Time Serial] in field. Save. </li></ul><ul><li>This will show 5:15:12 AM. </li></ul>Admissions AIN102 Module 1
  93. 93. Result Admissions AIN102 Module 1 [end module]

×