locked
Where are data from contact stored in database RRS feed

  • Question

  • Hi

    We have on contact(birthdate) in aplication 1954.3.3 but in database table dbo.contactbase and view contact is 1954.3.2

    where are stored data from contact in database, or we have wrong data server?

    Tuesday, April 20, 2010 7:42 AM

Answers

  • Why dont you use CRM filtered views?
    • Proposed as answer by Edwin2win Tuesday, April 20, 2010 11:30 AM
    • Marked as answer by Jim Glass Jr Tuesday, April 20, 2010 3:17 PM
    Tuesday, April 20, 2010 10:15 AM
  • SELECT birthdate, birthdateUtc FROM filteredcontact

    This can provide you the details. birthdateUtc field will provide you the final converted datetime.

    Using filtered view is a better option than trying to query the datatables directly in CRM database. FilteredViews filter out the contacts that are deleted. But yes the filtered views brings the contacts that are inactive as well. if you wish to get data only for active contacts then use the following SQL

    SELECT birthdate, birthdateUtc FROM filteredcontact WHERE statecode = 0

    Hope this has helped you.

    • Marked as answer by Jim Glass Jr Tuesday, April 20, 2010 3:16 PM
    Tuesday, April 20, 2010 10:24 AM

All replies

  • Everything is correct. This difference occurs because DateTime fields are saved in UTC format.

    Truth is opened the prepared mind

    My blog (english)
    Мой блог (русскоязычный)
    Tuesday, April 20, 2010 7:51 AM
    Moderator
  • Yes, as Andriy correctly say it is UTC time so when you retrieve the data at that time retrieve usertime (localtime) value and it will give you correct date..

    for e.g. bday is your birthday field on contact then below will give you correct date..

    myCrmContact.bdat.UserTime

    check this link http://msdn.microsoft.com/en-us/library/cc189850.aspx for more information on this.

    Hope this helps..

    Tuesday, April 20, 2010 8:06 AM
  • If i understand you correctly, you re trying to find the birthday field data for contact through SQL.

    The field will be stored in the dbo.contactbase table of the CRM organization in the database server.

    You can find the location of your database server within the registry settings of the CRM server.

    The database name will be the CRM organization that you have created i.e. like <organizationname>_MSCRM.

    If you do not find the table and the fields then you are probably in the wrong database.

    Please let me know if you need further details or still have some issues. Hope this has helped you.

    Regards.

    Tuesday, April 20, 2010 9:57 AM
  • We have excel pivot table which uses for data view in CRM database.

    MayankP this is solution for .net 

    we need sql solution for changing date to correct format.

     


    Tuesday, April 20, 2010 10:11 AM
  • Why dont you use CRM filtered views?
    • Proposed as answer by Edwin2win Tuesday, April 20, 2010 11:30 AM
    • Marked as answer by Jim Glass Jr Tuesday, April 20, 2010 3:17 PM
    Tuesday, April 20, 2010 10:15 AM
  • SELECT birthdate, birthdateUtc FROM filteredcontact

    This can provide you the details. birthdateUtc field will provide you the final converted datetime.

    Using filtered view is a better option than trying to query the datatables directly in CRM database. FilteredViews filter out the contacts that are deleted. But yes the filtered views brings the contacts that are inactive as well. if you wish to get data only for active contacts then use the following SQL

    SELECT birthdate, birthdateUtc FROM filteredcontact WHERE statecode = 0

    Hope this has helped you.

    • Marked as answer by Jim Glass Jr Tuesday, April 20, 2010 3:16 PM
    Tuesday, April 20, 2010 10:24 AM
  • that`t it, filteredcontact is solution,

     

    thanks :)

    Tuesday, April 20, 2010 10:58 AM