Source language: Translate to:

storing date dbpro - ms access

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

storing date dbpro - ms access

Postby yanzco » Thu Dec 11, 2014 7:26 am

i was wondering

i took variable in neobook the date..
and stored it to ms access field with data type (date/time)

opened ms access and its stored in numbers like 1234789417247

how do i store
MM/DD/2014 only

and
3:15pm only


other workaround i did to my other program was set data type to "text"..
wednesday 12/11/2014

works ok, but i cant sort ascending / descending the dates properly..
it sorts to alphabetically..

so this time, im trying to make it work with data type "date/time"
but i cant seem to make it work properly..
the variables are way off.. or probably correct, but ms access just reads it different way..
yanzco
 
Posts: 175
Joined: Sun Jul 20, 2014 4:07 am

Re: storing date dbpro - ms access

Postby stu » Thu Dec 11, 2014 8:05 am

What version of Access? can you provide a sample db?

Access! :evil:
Microsoft Access hater.
User avatar
stu
 
Posts: 318
Joined: Wed Aug 07, 2013 11:37 am

Re: storing date dbpro - ms access

Postby Gaev » Thu Dec 11, 2014 8:19 am

yanzco:

i took variable in neobook the date..

Do you mean that you did something like ...
Code: Select all
DefineVar "[Birthdate]" "Date" "mm/dd/yyyy" "Global" "01/23/1914"

If so, try ...
Code: Select all
NumToDate "[Birthdate]" "m/d/yyyy" "[FormattedDate]"

... then pass [FormattedDate] to the Access DB field.

stored it to ms access field with data type (date/time)
how do i store
MM/DD/2014 only

and
3:15pm only
Not sure how you can define time in NeoBook's Date type variable ... but you might try appending the time to [FormattedDate] before passing it to the Access DB field.

other workaround i did to my other program was set data type to "text"..
wednesday 12/11/2014

works ok, but i cant sort ascending / descending the dates properly..
it sorts to alphabetically..

You can store two fields in the Access DB ... the first one like you have (text field with MM/DD/YYYY for human consumption) ... and another (hidden from user view) that contains the the variable used with DefineVar ... in above example [Birthdate (whose value like 1234789417247 is the "elapsed number of days since some very old date like December 31, 1899") ... do your sorts on the second field
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: storing date dbpro - ms access

Postby yanzco » Thu Dec 11, 2014 8:52 am

access 2002-2003

ill try and see if it works guys..
yanzco
 
Posts: 175
Joined: Sun Jul 20, 2014 4:07 am

Re: storing date dbpro - ms access

Postby Neosoft Support » Thu Dec 11, 2014 12:45 pm

NeoBook may be misinterpreting the date as a mathematical formula. For example:

12/11/2014

might be seen by NeoBook as:

12 div 11 div 2014

To prevent this add an exclamation point character (!) in front of the date. For example:

SetVar "[MyDB.Table.DateField]" "!12/11/2014"

or

SetVar "[MyDB.Table.DateField]" "![DateShort]"
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest