How to get Date portion of DateTime field?
From: GaryZ (GaryZ_at_discussions.microsoft.com)
Date: 01/12/05
- Next message: David Portas: "Re: Query performance MS-Access vs. SQL-server 2000"
- Previous message: Brian Moran: "Re: Query performance MS-Access vs. SQL-server 2000"
- Next in thread: Nadim Wakim - Lebanon: "Re: How to get Date portion of DateTime field?"
- Reply: Nadim Wakim - Lebanon: "Re: How to get Date portion of DateTime field?"
- Reply: Alejandro Mesa: "RE: How to get Date portion of DateTime field?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 12 Jan 2005 06:13:02 -0800
I'm trying to import an SQLServer table into Visual FoxPro (I'll also post
this in the VFP forum). I need to test the Date portion of a SQL Server
DateTime field against a user-entered Date.
I tried the following:
m_getagsc = SQLPREPARE(gnConnHandle, "SELECT * FROM AgentStateChange "+;
"WHERE AgentStateChange.ToState > 2"+;
"AND TTOD(AgentStateChange.Time) = ?m_rptdate", "agsc")
m_getagsc = SQLEXEC(gnConnHandle)
After this statement, m_getagsc = -1.
This works without the "AND TTOD(AgentStateChange.Time) = ?m_rptdate".
m_rptdate is a variable containing the user's entered date.
TTOD() is Visual FoxPro's function for returning the Date portion of a
DateTime field. I guess what I need is the SQLServer equivalent.
Thanks,
GaryZ
- Next message: David Portas: "Re: Query performance MS-Access vs. SQL-server 2000"
- Previous message: Brian Moran: "Re: Query performance MS-Access vs. SQL-server 2000"
- Next in thread: Nadim Wakim - Lebanon: "Re: How to get Date portion of DateTime field?"
- Reply: Nadim Wakim - Lebanon: "Re: How to get Date portion of DateTime field?"
- Reply: Alejandro Mesa: "RE: How to get Date portion of DateTime field?"
- Messages sorted by: [ date ] [ thread ]