Solved

access stored date/time field failed

Posted on 2004-04-29
21
367 Views
Last Modified: 2013-12-18
Hi,
I am using R5 and I have a field of date/time type.
after that want to retrieve the month and year value from that field
I use
@month(field1) + @year(field1) but it failed
but when i try @month(@Now)) then is is okay
so i guess it is stored as a string.

I searched the help in R5 and it says CDat can be used
to convert String to Date but turns out R5 says it is invalid.

0
Comment
Question by:damoncwk
  • 8
  • 4
  • 3
  • +2
21 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10955932
Try @TextToTime

~Hemanth
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10955938
cdat should be used in lotus script

use @Month(@TextToTime(field1))+@Year(@textToTime(field1))
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10955946
1 minute difference hemantha.
Still ur awake? By this time u should be finishing ur dinner and sleeping.

Take good rest.

~madheeswar
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10955969
Just waiting for you to grab these questions ;-)

Just Kidding.. Got some new updates going tonight...
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10956031
OK. I want to grab all the questoins which I am able to answer.Since my knowledge is limited.

have a good sleep.

Bye,
madheeswar
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10956128
Good spirit... keep it up.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 10956476
Check this:

FIELD field1:=field1;
@Text(field1;"D3S0")



0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10956488
Zvonko,
he needs Month and year.

taking permission from Zvonko,
FIELD field1:=field1;
res:=@Text(field1;"D3S0");
@Month(res)+@Year(res)
If I am not wrong, u want to concatenate both month and year of field1.

So, i propose,

FIELD field1:=field1;
res:=@Text(field1;"D3S0");
@text(@Month(res))+@text(@Year(res))


0
 

Author Comment

by:damoncwk
ID: 10956490
Hi,
After I use
@Month(@TextToTime(field1))+@Year(@textToTime(field1))
it returns -2

somehow i found out that TextToTime(field1) returns null.

However if I only use field1 then the date/time value is shown correctly.
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10956502
FIELD field1:=field1;
@Month(@TextToTime(field1))+@Year(@textToTime(field1))

What u want?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:damoncwk
ID: 10956757
FIELD field1:=field1;
@Month(@TextToTime(field1))+@Year(@textToTime(field1))

i tried the above
but it turns out TextToTime returns null
and actually the value of field1 is set to @Now

0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10957051
where u are displaying this end result?

And refresh the document.

and also since ur using @Now in field1, then why can't u implement it directly instead of field1?

and create any date field and give the date and refresh insead of having field1 in the formula.
0
 

Author Comment

by:damoncwk
ID: 10957070
in a form I have the field1 which stores @Now that the user fills in the form
then in a View I create a column which have formula of
@Month(@TextToTime(field1))
however it returns nothing for @TextToTime(field1)
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10957139
may be some where while saving or at Querysave ur removing it.

create a new computed field (this will refresh everytime) or Computed when composed(this won't refresh, so use this)
and assign the formula @now in default. name it as createdon_d. it should be a text field.

and save a new document.

and in column formula:
@Text(@Month(@TextToTime(createdon_d)))+"-"+@text(@Year(@textToTime(createdon_d)) )

this should work.

and if it is not displaying, then in the doc., properties, chec the value of createdon_d. it should display some value.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 10957576
madheeswar,
you are allowed to extend my example, but not to extend it in wrong direction!
In your example is "res" of type Text, so you cannot get @Month(res)

And beside that is the whole formating NOT necessary. The format string "D3S0" yields Month and Year!

0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 10957587
In the view, select the document, and open the document properties.  See if field1 is there, and what the value is, and the type (should be DATE TIME or something similar).

If that exists, it should work.

To format your time , you can use @text.  In your case:

@text(field1;"D3")

You can also do the formatting yourself , the check will avoid errors when field1 is empty.

@if(field1="";"No field1 in document";
@right("00"+@text(@month(field1));2)+"/"+@text(@year(field1)))

No check , but a default for field1 is also possible

DEFAULT field1 := @now;
@right("00"+@text(@month(field1));2)+"/"+@text(@year(field1))

cheers,

Tom

0
 
LVL 63

Accepted Solution

by:
Zvonko earned 50 total points
ID: 10957591
Here my tested code:

FIELD field1:=@Now;
@Text(field1;"D3S0")

0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 10957597
So the formatting was already mentioned by Zvonko , sorry, missed that.
He is right, it's only 1 line of code

Tom
0
 
LVL 15

Expert Comment

by:Bozzie4
ID: 10957617
And in his example, change this to :

DEFAULT field1:=@Now;
@Text(field1;"D3S0")

So that, when field1 is empty (only when field1 is empty), it is replaced by @now.

BTW, be careful when using this (or any time function) in a view, because this will slow down the view  - it will have to be recalculated every time it's opened !

cheers,

Tom
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 10958427
Why the grading B???
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 10958462
Zvonko,
may be he/she is not satisfied.



damoncwk,
if you are not satisfied with the answer, you should have asked what you need and what is not working. Instead you took the code what Zvonko provided and given a grade "B" which is not encouraging for us. we kept lot of efforts in answering your question. try to understand.

Please a question in community support with this link and tell them to change to grade "A". It is free(0 points)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Saving email w/ attachments using lotus notes 7 283
Lotus notes email code 6 112
Lotes Notes 8.5.3 std can not open calendar 2 99
Lotus Notes Database "Invalid NSF Version" 5 1,785
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now