Access_Criteria2.pptx

download Access_Criteria2.pptx

of 7

Transcript of Access_Criteria2.pptx

  • 7/23/2019 Access_Criteria2.pptx

    1/7

    Query criteria 2: Using date criteria in queries

    j

    then press F5 or click Slide Show > From Beginning tostart the course.

    In the message bar click Enable Editing

    I! the "ideos in this course don#t play you mayneed to do$nload Quick%imeor justs$itch to &o$er&oint 2'().

    http://office.microsoft.com/redir/XT103834044.aspxhttp://office.microsoft.com/redir/XT103864844.aspxhttp://office.microsoft.com/redir/XT103864844.aspxhttp://office.microsoft.com/redir/XT103834044.aspx
  • 7/23/2019 Access_Criteria2.pptx

    2/7

    5 *( 2 ) +

    ,oursesummary

    -elp

    ()

    "ideos

    Query criteria 2: Using date criteria in queries ,losed captions

    /ummary Feedback -elp%he basics ,alculated0elds

    1ate1i1ate3dd

    +:(42:)' ):(

    &ress F5 to start 6sc tostop

    7hen you use criteria to 0lter your query results date criteria can be kind o! tricky.

    /o in this course I8ll sho$ you ho$ to use date criteria in queries starting $ith thebasics.

    %o 0lter !or date "alues you surround them $ith pound signs like this.

    I! you don8t use pound signs you $on8t get a result.

    3nd remember you need to enter the entire "alue in the 0eld. I! you enter part o! onelike this you $on8t get a result.

    9o$ the eample you just sa$ 0ltered !or a single date.

    I! you $ant more ;eibility you can use the

  • 7/23/2019 Access_Criteria2.pptx

    3/7

    5 *( 2 ) +

    ,oursesummary

    -elp

    2)

    "ideos

    Query criteria 2: Using date criteria in queries ,losed captions

    /ummary Feedback -elp

    &ress F5 to start 6sc tostop

    %he basics ,alculated0elds

    1ate1i1ate3dd

    +:(42:)' ):(

    %he epressions $e sa$ in the pre"ious "ideo only $ork on $hole date "alues.

    For eample this epression returns data !or all dates ecept Aarch 22nd o! 2'().

    @ut i! I only use part o! the date "alue in my epressions I get no result.

    /o $hen you need to 0lter on part o! a date "alue you can use a calculated 0eld.

    ,alculated 0elds don8t eist in your data.

    Instead they display the results o! calculation that you de0ne in a ne$ 0eld in yourquery.

    3s a 0rst eample I8ll 0lter !or assets purchased in a gi"en year.

    ,lick the top ro$ o! a blank 0eld enter equals =63BCthat8s the !unctionCand a set o!parentheses.

    In the parentheses add a pair o! brackets and then 3cquired 1ate the 0eld $ith my date"alues.

    In the ,riteria ro$ I8ll enter 2'() and notice that I don8t use quotes or pound signsaround the "alue.

    =ou do that because the =63B !unction returns a number so I can just use the numberhere.

    I8ll also hide the 3cquired 1ate 0eld that makes the data easier to read

    and you can see the criteria 0lters !or assets purchased in 2'().

    /o back to 1esign "ie$ and notice this: 3ccess ga"e the 0eld a name and remo"ed theequal sign.

    %hat8s normal and i! you $ant to you can rename the 0eld another $ay to make yourdata easier to understand.

    3lso you need to remember a key piece o! synta.

    7hen you use a 0eld name in an epression and the name has spaces put it in bracketslike this.

    ,apitaliDation doesn8t matter but spelling does.

    3s another eample say your boss needs to kno$ $hat $as purchased during the secondquarter o! 2'().

    For this I8ll use the 1ate&art !unction because it lets me 0lter on time inter"alsCmonthsand so on.

    %he !unction uses any o! ten inter"al settings !rom years do$n to seconds and here theyare.

    3nd don8t try to memoriDe these no$. %he course summary has links to this in!ormation.

    %he !unction also requires a date either a speci0c date or a list o! dates in a 0eld.

    /o a!ter 1ate&art I enter Eq because I $ant to 0lter by quarter and make sure you usequotes around this setting.

    3dd a comma a!ter the quotes and then 3cquired 1ate

    because that8s the 0eld $here the date "alues are and don8t !orget the brackets.

    9o$ enter 2 in the ,riteria ro$ because you $ant results !or the second quarter and runthe query.

    Finally you can do a lot more $ith epressions than $hat you8"e seen here

    so the course summary has links to more in!ormation.

    9et $e8ll see ho$ to calculate inter"als bet$een dates $ith the 1ate1i !unction

    and ho$ to add or subtract dates $ith the 1ate3dd !unction.

  • 7/23/2019 Access_Criteria2.pptx

    4/7

    5 *( 2 ) +

    ,oursesummary

    -elp

    ))

    "ideos

    Query criteria 2: Using date criteria in queries ,losed captions

    /ummary Feedback -elp

    &ress F5 to start 6sc tostop

    %he basics ,alculated0elds

    1ate1i1ate3dd

    +:(42:)' ):(

    Get8s look at ho$ to use the 1ate1i and 1ate3dd !unctions in query criteria and $e8llstart $ith 1ate1i.

    1ate1i calculates the number o! time inter"als such as days or months bet$een t$o1ate%ime "alues.

    %he !unction requires an inter"al setting !ollo$ed by a start date and an ending date.

    -ere8s a list o! the inter"al settings and don8t try to memoriDe them no$. %he coursesummary has a link to them.

    /o as an eample here8s a query that returns order dataC$hen an order $as placed$hen it $as due and $hen it $as shipped.

    9o$ let8s say you need to kno$ $hich orders $ere late and by ho$ many days.

    Ho to 1esign ie$ epand a blank 0eld enter a 0eld name a colon 1ate1i andparentheses.

    I $ant to kno$ ho$ many days an order $as late so I enter Ed the day inter"al $iththe quotes and a comma a!ter.

    For my starting and ending dates I8ll enter brackets $ith a comma bet$een them thenthe 0eld names.

    %hat $ay I don8t !orget the brackets.

    9o$ let8s stop and go back to the un0ltered data !or a moment.

    =ou can see that not all o! the orders are late. /ome are early and some are on time.

    /o i! I run my query as it is no$ I get a lot o! negati"e "alues and those numbers pointto orders that shipped on time.

    @ecause I only $ant to see late orders I enter a greaterthan sign and Dero in the ,riteriaro$

    and sort the results in 1escending order.

    Bun the query and there you go.

    =ou use the 1ate3dd !unction $hen you need to add date "alues together.

    1ate3dd $orks a lot like 1ate1i but it uses slightly dierent synta.

    =ou start $ith an inter"al but then you speci!y a number and this is the number o!inter"als you $ant to add.

    /o i! I speci!y the year inter"al then ) I8m adding ) years8 $orth o! "alues.

    =ou !ollo$ that $ith a date and this is the date you8ll add your "alues to.

    /o in this eample I8m 0ltering !or three years8 $orth o! data starting $ith

  • 7/23/2019 Access_Criteria2.pptx

    5/7

    -elp ,ourse summary

    &ress F5 to start 6sc tostop

    ,ourse summaryCQuery criteria 2: Using date criteria in queries

    /ummary Feedback -elp

    5 *( 2 ) +

    %he basics ,alculated0elds

    1ate1i1ate3dd

    +:(42:)' ):(

    See also Using dates as criteria in 3ccess querie

    s @uild an epression

    ,hoose the right date !unction

    1ate&art 1ate1i J 1ate3dd

    Aore training courses

  • 7/23/2019 Access_Criteria2.pptx

    6/7

    ,heck out more courses

    -elp ,ourse summary

    &ress F5 to start 6sc tostop

    Bating and comments

    %hank you !or "ie$ing this course

    -o$ did $e doV &lease tell us $hat you think

    /ummary Feedback -elp

    5 *( 2 ) +

    %he basics ,alculated0elds

    1ate1i1ate3dd

    +:(42:)' ):(

    http://o15.officeredir.microsoft.com/r/rlidMoreCourses?clid=1033http://o15.officeredir.microsoft.com/r/rlidMoreCourses?clid=1033http://office.microsoft.com/redir/RZ104015435.aspx?section=2http://office.microsoft.com/redir/RZ104015435.aspx?section=2http://o15.officeredir.microsoft.com/r/rlidMoreCourses?clid=1033http://o15.officeredir.microsoft.com/r/rlidMoreCourses?clid=1033
  • 7/23/2019 Access_Criteria2.pptx

    7/7

    -elp ,ourse summary

    &ress F5 to start 6sc tostop

    -elp

    /ummary Feedback -elp

    5 *( 2 ) +

    Using &o$er&oint#s "ideo controls&oint at the bottom edge o! any "ideo to start stop pause or re$ind. =ou drag tore$ind.

    Hoing places=ou can go to any part o! a course by clicking the thumbnails Llight or shadedNbelo$ the "ideo. =ou can also click the !or$ard and back arro$s or press &age Upor &age 1o$n.

    /topping a courseI! you#re "ie$ing online click your bro$ser#s @ack button. I! you#re "ie$ing oWinepress 6sc. I! you#re $atching a "ideo press 6sc once to stop the "ideo again to stopthe course.

    I! you do$nload a course and the "ideos don#t play

    ,lick Enable Editing i! you see that button. I! that doesn#t $ork you may ha"e&o$er&oint 2'' or earlier. I! you do you need to get the &o$er&oint ie$er . I! you ha"e&o$er&oint 2'(' you need the Quick%ime player or you can upgrade to &o$er&oint 2'() .

    %he basics ,alculated0elds

    1ate1i1ate3dd

    +:(42:)' ):(

    http://office.microsoft.com/redir/XT101907941.aspxhttp://office.microsoft.com/redir/XT103834044.aspxhttp://office.microsoft.com/redir/XT103864844.aspxhttp://office.microsoft.com/redir/XT103864844.aspxhttp://office.microsoft.com/redir/XT103834044.aspxhttp://office.microsoft.com/redir/XT101907941.aspx