Showing posts with label individual. Show all posts
Showing posts with label individual. Show all posts

Thursday, March 29, 2012

Concatenate 2 date fields to show long date

How can I concatenate 2 fields (both declared as datetime) to show them in long date format.
I tried placing a hidden text box with each individual field formatted as long date. This works. However when I try joining these 2 fields in a new text box I get invlaid expression using the following syntax:
me.hidDateFrom.Value & me.HidDateTo.Value

This seems like an easy feat, but obviously not...

Thanks for any pointers.

You have to explain this better. Are you trying to get 2 column values (both datetime type) in one TextBox control by simply concatenating the string values? You may want to show what the column values are in your table as well as what you expect to see within the TextBox.|||

OK.

I'm trying to concatenate to datetime parameter values so that I get:
Report for the period 15 March 2006 to 20 March 2006.
15 March 2006 being the data returned from the startDate parameter whose value using this example is 15/03/2006 and 20 March 2006 being the data returned from the EndDate parameter whose value using this example is 20/03/2006.

I need to format the 2 datetime parameters to long dates AFTER input to show in a text box.
Hope this is more clear.

Tuesday, March 27, 2012

Concantenating Dates

I am transferring data between DB's. One has DATE and TIME as two individual fields. I need to concantenate them into a single DATETIME field. I am sure the solution is simple but I can't figure it out.
Any advice?
Thanks!If you select from your time column, you should see that it's date is set to January 1st, 1900, like this:
1900-01-01 14:59:27.293

Your date column should show a date as of midnight like this:
2003-07-14 00:00:00.000

If this is the case, you can just add these value together to concatenate them:
select @.Yourdate + @.Yourtime

If this is not the case, you will need to concatenate them as formatted strings and then cast or convert the result to a datetime value.

blindman