February 14, 2007 at 1:51 pm
I have 2 fields in a Crystal Designer that I need to use Minutes if it is greater than 0, and units if the minutes are 0. The fields are both text. How to I do this? I can use the Format field in Access, but am less versed in SQL for Crystal.
February 14, 2007 at 3:14 pm
I am assuming you mean Varchar/Nvarchar by text but based on your requirement for minutes and seconds in SQL Server you can only store it in DateTime. The reason is SmallDateTime is to the minute because of limited resolution so if you plan to do calculations with the content of the column you can only use DateTime. Hope this helps.
Kind regards,
Gift Peddie
February 14, 2007 at 10:54 pm
Hi
You could create a formula within Crystal to do the convert for you too. Crystal has the date fuctions that should help.
February 15, 2007 at 11:07 am
You can create a formula for the field that gets populated based upon your two variables. If I understand correctly, check these out as samples of where to start
IF DatePart ("M",YOURTIMEFIELDHERE )> 0 THEN (YOURFIELD??) ELSE (YOURTIMEFIELD)
OR
IF DatePart ("M",YOURTIMEFIELDHERE )> 0 THEN (YOURFIELD??)= (YOURTIMEFIELD) ELSE (YOURFIELD) = (YOURUNITDESCRIPTION)
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply