• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 253
  • Last Modified:

Date format issue

Hello all

I need your help where i need to modify the date.

I'm using that code to put the date from: MSHFlexGrid1.TextMatrix(k, 2) with this format "Monday  October-10", to have the same date in MSHFlexGrid1.TextMatrix(k, 0) but -1 day, so the result would be for ex: Sunday October-9

How can i do that please?

MSHFlexGrid1.TextMatrix(k, 0) = MSHFlexGrid1.TextMatrix(k, 2) 

Open in new window



Thanks
0
Wilder1626
Asked:
Wilder1626
  • 3
  • 3
1 Solution
 
Brook BraswellApplication Development ManagerCommented:
Do you have the date with the year somewhere in your grid or in your recordset ?
without the year in the value somewhere, it would be hard pressed to know the day of week.

You can not convert "Monday October-10" to a simple date by itself...
with the date underneath

MSHFlexGrid1.TextMatrix(k, 0) = format(Origianldate -1,"dddd MMMM-DD")
0
 
Wilder1626Author Commented:
In this format, will it work:
Monday  2011-Oct-10

I can change the date format with no problem.
0
 
Wilder1626Author Commented:
What date format would be the best to have, to do this?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Brook BraswellApplication Development ManagerCommented:
I would suggest to keep MSHFlexGrid1.TextMatrix(k, 2)  as it is but have a hidden column with the date that you use to populate it.  Then use that to populate the new value...
In this example k,22 is the column containing a date.  I do not know where you want to store it so replace 22 with the appropriate column.

MSHFlexGrid1.TextMatrix(k, 0)  = format(cdate( MSHFlexGrid1.TextMatrix(k, 22)) -1,"dddd mmmm-dd")
0
 
Brook BraswellApplication Development ManagerCommented:
BTW - having the Day of week at the beginning causes the problem.
if the value was simply "2011-Oct-10" then you could use CDate as shown above.

0
 
Wilder1626Author Commented:
Perfect


Thanks, this is working great now.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now