Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to mix Char and Datetime

Status
Not open for further replies.

Wallie12

MIS
Mar 5, 2004
92
US
I need a field to have possible mix results such as when

IF SID = A then "NA"
ELSE
IF SID = B then DATETIME
ELSE
IF SID = C then "-'

Thanks for the help!
 
Hi,
What type of field is SID in the database?

You could convert the DATETIME to a string using something like
Code:
IF SID = A then 
"NA"
ELSE 
IF SID = B 
then 
ToText(DATETIME,'formatstring')
ELSE 
IF SID = C 
then "-'







[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
When I do use the following
IF SID = A then
"NA"
ELSE
IF SID = B
then
ToText(DATETIME,'formatstring')
ELSE
IF SID = C
then "-'

??? How do I select 24 hour formatting for Hours and Time?
 
Hi,
If you use HH and not hh for the hours it should show in 24hr format.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Can you provide me with an example Please

ToText(DATETIME,'formatstring')

I am clueless!

Thanks
 
The format you are looking for 24 hour time is "HH:mm".

The format string is case sensitive. "hh:mm" is 12 hour clock, and "dd-MM-yyyy" gives you day-month-year while "dd-mm-yy" gives you day-minute-year

Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top