Source language: Translate to:

query date and time

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

query date and time

Postby yanzco » Sat Dec 20, 2014 12:51 pm

im having a problem with querying dates.. in accessdatabase 2003

(for my attendance)

which was solve with placing # to front and end of the date variable
dbpQuery "Minindaldb" "Attendance" "SID = [ASID] AND ADate = #[DateToday]#

now im having problem with the time

for some reason..
when i setvar [Minindaldb.attendance.timein] [Time]

it stores "8:30:10 AM" and shows "8:30:10 AM" to text with [Minindaldb.attendance.timein]

but when i switch to another person..
and change back to previous person..

the [Minindaldb.attendance.timein] shows 12/30/1899 8:30:10 AM

how can i make it just show the time..

and if i dbpquery a time.. it shows an error
even doing dbpQuery "Minindaldb" "Attendance" "SID = [ASID] AND ADate = #[DateToday]# AND ATime = #[Timein]#
doesnt work...

how to query time?..
yanzco
 
Posts: 178
Joined: Sun Jul 20, 2014 4:07 am

Re: query date and time

Postby Gaev » Sat Dec 20, 2014 1:12 pm

yanzco:

According to this web page from Microsoft, there is no field in MS Access database that only stores the "time of day".

Also, see the Help information for dbpCreateTable ... where it states ...
Time
Time. This type is not supported by MS Access, use DateTime instead.**


how can i make it just show the time..

You can store it in a String type field ... and if you need to do math (like sort or calculate difference) on this field, you can store "the number of minutes/seconds past midnight" in an Integer (–32,768 and 32,767) or BigInt (–2,147,483,648 and 2,147,483,647) field ... then, you can display the String field to the user ... and when required, use the numeric field to do the math.
User avatar
Gaev
 
Posts: 3736
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest