How to get DatePicker to use only Short Date format (No Time)

Hello,

I have a form that runs a query for a specified date span. I'm using the datepickers to select the dates but they are "inserting" a timestamp as well. The formatting in my table is short date (1/1/2008) is there a way to format this so that I only get date values out of the date picker?

Thanks!
c9k9hAsked:
Who is Participating?
 
rockiroadsConnect With a Mentor Commented:
another one I use, long winded but dunno I seem to prefer this way


sSQL = sSQL & "WHERE Custodian = '" & Me.cboCustodian & "' And format(WeekOf Between,'YYYYMMDD') >= " & format(DFrom,"YYYYMMDD") & " And format(WeekOf Between,'YYYYMMDD') <= " & format(dTo,"YYYMMDD")
0
 
rockiroadsCommented:
could you not change your query to format the date in your date span?
0
 
rockiroadsCommented:
or failing that, when you read the date from the datepicker, format it then?
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
c9k9hAuthor Commented:
Hmmm. Format it in the query? it's straight SQL and looks like this:

sSQL = ""
sSQL = sSQL & "SELECT Sum(GoalPC) AS PC "
sSQL = sSQL & "FROM Goals "
sSQL = sSQL & "WHERE Custodian = '" & Me.cboCustodian & "' And WeekOf Between #" & DFrom & "# And #" & DTo & "#"
Set rsActivity = CurrentDb.OpenRecordset(sSQL)
Me.k7 = rsActivity!PC

what is happening is, it's not including the start date in the query. For instance, if i have records on 10/6/08 i can't set the date picker to that date, it has to be the date before 10/5/08 to capture that data... Perhaps there is something else I could use besides "Between"?
0
 
c9k9hAuthor Commented:
And if i use regular text boxes to input the date it works fine... so it must not be the "Between" statement.
0
 
rockiroadsCommented:
What about

Between #" & format(dfrom,"short date") & "# and #" & format(dTo,"short date") & "#"

0
 
c9k9hAuthor Commented:
Perfect, thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.