|
Home > Archive > FoxPro Help and Support > October 2005 > Date Time formatting
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Date Time formatting
|
|
| Mike B 2005-09-28, 1:24 pm |
| probably a daft question but i just can't figure it out. I am using SQL
server as my back end data engine so all dates are stored as date time.
What filters or masks can i use to only give the users access to the Date
part of the field for editing.
ctod(dtoc()) works fine for display only but is no good for bound controls
or grids that require user input
| |
| Pierre Albisser 2005-09-28, 8:26 pm |
| Hi Mike!
Don't think it's a daft question - couldn't figure it out, neither.
My workaround would be something like:
1) Adjusting width of textbox to width of date alone, then
2) in the Interactivechange() of the textbox, if selstart is > 10 (or 8
in short datetime format), force jump to next field via KEYBOARD {TAB}
This works in my testing range, but haven't tested it too much, yet.
THe other way, of course, would be creating a cursor (with a date field
instead of a datetime), APPENDing the data and checking for changes in
every afterrowcolumnchange
or so.
--
HTH,
Pierre
/"\ ASCII Ribbon Campaign
\ /
X Against HTML
/ \ in e-mail & news
| |
| Mike B 2005-09-29, 3:25 am |
| I said daft as I thought there was somthing simple i was overlooking. Seems
to me it should have been thought of by the developers.
your workaround tested out ok even in bound grids
Thanks
"Pierre Albisser" wrote:
> Hi Mike!
>
> Don't think it's a daft question - couldn't figure it out, neither.
> My workaround would be something like:
>
> 1) Adjusting width of textbox to width of date alone, then
>
> 2) in the Interactivechange() of the textbox, if selstart is > 10 (or 8
> in short datetime format), force jump to next field via KEYBOARD {TAB}
>
> This works in my testing range, but haven't tested it too much, yet.
>
> THe other way, of course, would be creating a cursor (with a date field
> instead of a datetime), APPENDing the data and checking for changes in
> every afterrowcolumnchange
or so.
>
> --
> HTH,
> Pierre
>
> /"\ ASCII Ribbon Campaign
> \ /
> X Against HTML
> / \ in e-mail & news
>
| |
| Anders 2005-09-29, 3:25 am |
| If you fetching SL Server data to a view:
DBSETPROP('view. column','FIELD','Dat
aType', 'D' )
SQL Server is quite happy with an ANSI date like '2005/12/23' or American
type '12/23/2005'. The time portion will be set to 0.
-Anders
"Mike B" <Mike B@discussions.microsoft.com> skrev i meddelandet
news:63E4090C-DC76-4A95-87DB- D5248956982C@microso
ft.com...
> probably a daft question but i just can't figure it out. I am using SQL
> server as my back end data engine so all dates are stored as date time.
>
> What filters or masks can i use to only give the users access to the Date
> part of the field for editing.
>
> ctod(dtoc()) works fine for display only but is no good for bound controls
> or grids that require user input
| |
| Mike B 2005-09-29, 8:25 pm |
| i am using SQL pass through so i have no local db with views etc.. so can
apply a simalar method to that. if so how
Thanks
"Anders" wrote:
> If you fetching SL Server data to a view:
> DBSETPROP('view. column','FIELD','Dat
aType', 'D' )
> SQL Server is quite happy with an ANSI date like '2005/12/23' or American
> type '12/23/2005'. The time portion will be set to 0.
>
> -Anders
>
> "Mike B" <Mike B@discussions.microsoft.com> skrev i meddelandet
> news:63E4090C-DC76-4A95-87DB- D5248956982C@microso
ft.com...
>
>
>
| |
| Anders 2005-09-29, 8:25 pm |
| Are you displaying the raw result set in a browse or grid?
-Anders
"Mike B" <MikeB@discussions.microsoft.com> skrev i meddelandet
news:31765641-DC02-4B82-B7DC- 22E617150C09@microso
ft.com...[color=darkred]
>i am using SQL pass through so i have no local db with views etc.. so can
> apply a simalar method to that. if so how
>
> Thanks
>
> "Anders" wrote:
>
| |
| Mike B 2005-10-01, 8:24 pm |
| grid and also a text box on a form. I am thinking i may have to create a
custom control
"Anders" wrote:
> Are you displaying the raw result set in a browse or grid?
> -Anders
>
> "Mike B" <MikeB@discussions.microsoft.com> skrev i meddelandet
> news:31765641-DC02-4B82-B7DC- 22E617150C09@microso
ft.com...
>
>
>
| |
| Anders 2005-10-02, 3:24 am |
| The DateTimePicker ActiveX can display the date part alone.
-Anders
"Mike B" <MikeB@discussions.microsoft.com> skrev i meddelandet
news:FC27B7A3-958A-47FB-8264- A39C281277D3@microso
ft.com...[color=darkred]
> grid and also a text box on a form. I am thinking i may have to create a
> custom control
>
> "Anders" wrote:
>
|
|
|
|
|