Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Coverting ODBC DateTime back to coldfusion DateTime

Posted on 2003-10-23
9
Medium Priority
?
313 Views
Last Modified: 2013-12-24
Hey!

I'm trying to convert a ODBC date time object back to coldfusion date time in order to see if two variables are equal. What is the function to do this?

Cheers Brad
0
Comment
Question by:bradderick
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 15

Expert Comment

by:danrosenthal
ID: 9611779
try parsedatetime()
0
 

Author Comment

by:bradderick
ID: 9611835
I've tried that and it doesn't seem to work....

what I've got is a ODBC datetime variable alreadyinserted.begindate and a coldfusion date time variable Begindate. Here's the context I;m using it in.....it doesn't generate an error, just doesn't work

<CFSET BeginDate = Now()>  

<CFSELECT NAME="BeginDate" REQUIRED="YES" MESSAGE="You must select a valid begin date">
          <CFLOOP FROM="1" TO="30" INDEX="i">
            <CFOUTPUT>
              <OPTION VALUE="#BeginDate#"<CFIF parsedatetime(AlreadyInserted.BeginDate) EQ BeginDate>SELECTED</CFIF>>#LSDateFormat(BeginDate,"DDD DD MMM YY")#</OPTION>
              <CFSET BeginDate = DateAdd('D', 1, BeginDate)>
            </CFOUTPUT>
          </CFLOOP>
        </CFSELECT>
0
 

Author Comment

by:bradderick
ID: 9611844
I'm trying to see if any of the values in the drop down list are the same as the date in the database and if so select it.

I've put in test data for a case where an item should be selected, however it doesn't, leading me to conclude that a ODBC date time cannot EQ a coldfusion date time
0
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
LVL 11

Accepted Solution

by:
hart earned 800 total points
ID: 9612112
try this out and let me know

<CFSET BeginDate = Now()>  

<CFSELECT NAME="BeginDate" REQUIRED="YES" MESSAGE="You must select a valid begin date">
         <CFLOOP FROM="1" TO="30" INDEX="i">
           <CFOUTPUT>
              <OPTION VALUE="#BeginDate#"<CFIF DateFormat(AlreadyInserted.BeginDate,'dd/mm/yyyy') EQ DateFormat(BeginDate,'dd/mm/yyyy')>SELECTED</CFIF>>#LSDateFormat(BeginDate,"DDD DD MMM YY")#</OPTION>
             <CFSET BeginDate = DateAdd('D', 1, BeginDate)>
           </CFOUTPUT>
          </CFLOOP>
       </CFSELECT>

Regards
Hart
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9612141
use DateFormat()

like :

#dateCompare(dateFormat(ODBCDAte,'dd,mm,yyyy'), dateformat(cfdate,'dd,mm,yyyy')#

HTH

let me know

K'Rgds
Anand
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9612143
oops hart - sorry hadnt refreshed my page ...  !
0
 

Author Comment

by:bradderick
ID: 9612165
Thanks Hart and LOL @ Anand :)
0
 
LVL 11

Expert Comment

by:hart
ID: 9612172
:-)

Regards
Hart
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9612192
:)
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Go t…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question