1
  • convert SQL datetime to date only

    Using SQL, how can I convert a data in a datetime field to a date only data? When I run a job to collect data, I use the getdate() function that returns the date and time. I want to then convert this to the same date but with a time of 00:00:00. Please advise. Thanks! ~Gina

    Gina35 pointsBadges:
  • SQL convert numeric to date format

    How can I convert an 8 digit numeric (format ccyymmdd) into a real datefield to be used in date arithmetics? I need to calculate the number of months between the month (current date) and a date represented in my DB as an 8 digit numeric with format "ccyymmdd". Therefor (I assume) I need to convert...

    DanTheDane2,555 pointsBadges:
  • Date calculation incorrect in sql when +1 month entered

    Date calculation incorrect in sql when 1 month entered. If we add 1 month to 28-Feb then it shows 28-Mar instead of 31-Mar. Similarly if I add 1 month to 30-Nov it should show 31-Dec instead of 30-Dec. SQL command run is SELECT CCDATE + 1 MONTHS FROM COGNOSMIS/xyzPF WHERE CCDATE = '2010-02-28'

    JohnsonMumbai1,160 pointsBadges:
  • SQL dynamic date calc.

    How shall the WHERE clause look for this challenge: Pseudocode: select all records from file where datefield (ccyymmdd 8.0) shall be greater than todays month minus 36 months. As you can see this may be expressed as [em]rolling 36 full months plusĀ current month[/em]. Any help will be apreciated....

    DanTheDane2,555 pointsBadges:
  • SQL Server datetime

    Hi - When I run this: select cast ('461129' as datetime) i get 2046-11-29 00:00:00.000 instead of 1946-11-29 00:00:00.000 Can you please let me know why and what I need to do in order to get the required results. thx

    DBM10 pointsBadges:
1

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following