Skip to main content
Dynamics 365 general forum
Suggested answer

ACCESSING MODIFIED DATE AND TIME FIELD IN DB

editSubscribe (0) ShareShare
ReportReport
Posted on by 5

I HAVE A TABLE NAMED WHSSHIPMENTTABLE WHICH CONSISTS OF FIELD CALLED MODIFIED DATE AND TIME 

I NEED TO WRITE A QUERY TO FILTER DATA ON PATICULAR DATE N TIME

THIS IS WHAT I WROTE:

SELECT *FROM DBO.WHSSHIPMENTTABLE WHERE CARRIERSERVICECODE='T' AND MODIFIEDDATETIME= 2021-01-05 14:51:48.000 ORDER BY MODIFIEDDATEANDTIME ASC;

it says syntax error near 14:51:48

Categories:
Attachments
  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 222,601 Super User on at
    RE: ACCESSING MODIFIED DATE AND TIME FIELD IN DB

    Use quoation marks around the value.

    SELECT *FROM DBO.WHSSHIPMENTTABLE
    WHERE CARRIERSERVICECODE='T'
    AND 'MODIFIEDDATETIME= 2021-01-05 14:51:48.000'
    ORDER BY MODIFIEDDATEANDTIME ASC;

    By the way, use Insert > Code (in ther rich formatting view) to paste source code to this forum, as I did.

Helpful resources

Quick Links

New Blog Features Released!

Check out the new community blog features for viewers and authors…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,080 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,601 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Featured topics

Product updates

Dynamics 365 release plans