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!

Extract Month 2

Status
Not open for further replies.
Jun 29, 2001
195
US
Have a date field that's text. In my crosstab i'm trying to only show the month of a call. I used the Mid to extract the mont it's yyyy-mm-dd. Now I need it to be the month name.

Ashley L Rickards
SQL DBA
 
Replace "2004-04-22" with your string date field:

monthname(val(mid("2004-04-22",6,2)));

~Brian
 
Try this:

MonthName(Month(CDate((Table.StringDate})))

-dave
 
Thanks .. I'm gettting an error 'The ) is missing.'

Ashley L Rickards
SQL DBA
 
Which code are you using?

Mine should work fine but I will modify it a bit.

monthname(val(mid({table.field},6,2)));

vidru probably just mistyped a "(" for a "{". His should be look like this:

MonthName(Month(CDate({Table.StringDate})))

~Brian
 
Here's another one but for hour so 7Am 8am .. 7PM. Any idea's? Thanks.

TimeValue(Hour(CTime({CallLog.RecvdTime})))

Ashley L Rickards
SQL DBA
 
You could place your formula on the report, and then just format it.

Right click the field.
Choose Format Field.
Click Date/Time tab.
Choose Customize.
Choose 12 Hour.
Set Minutes and Seconds to "None" in each of their dropdown lists.





~Brian
 
Gotcha .. that formatted it right but it only returns one column 12AM. Is my function correct? Thanks.

Ashley L Rickards
SQL DBA
 
I have a question that relates to replacing a 2 character text field with another 2 character text input in a formula. I'm using CR 9. Here's my example:{SA_1_NF.Ord_Class} like ["BVF", "CA", "CP", "ER", "ES", "EU", "OM", "ST"] The text that I want to replace is the "OM" field with "RM". Help. Thanks, CLewis
 
You should really start a new thread for this, but "If {SA_1_NF.Ord_Class} = "OM" then "RM" else {SA_1_NF.Ord_Class}" or Replace({SA_1_NF.Ord_Class},"OM","RM").

Place that in a formula, not your record selection.

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top