Re: inserting a date variable into a foxpro db
- From: "Cindy Winegarden" <cindy_winegarden@xxxxxxx>
- Date: Fri, 17 Jun 2005 13:21:16 -0400
Hi Theo,
Your code fragment is a little too small to see what's going on. Be sure
you're sending a Date data type and not characters or a DateTime data type.
Also, in SQL Pass-through the way to represent a Date in a text string is to
surround it with curly brackets. There is an ordinary date such as
{06/17/2003}, but the day an month can be confused depending on your Windows
date settings. To be sure you've got a strict representation of the date use
curly brackets and a caret: {^2005/06/17}. Also, you can represent a date
with the FoxPro Date() function. Date() is today and Date(2005, 6, 18) is
tomorrow. Finally, there is a CtoD() function (Character To Date) which
looks like CtoD("06/17/2005"). This can be problematic for determining the
day and month. One more thing, Fox accepts single and double quotes, and
also square brackets as string delimiters. This is especially useful in SPT
when one of your values is a character string.
Here's some code examples:
strSQL = "Insert Into MyDateField Values ({^2005/06/18})"
strSQL = "Insert Into MyDateField Values (Date(2005, 6, 18))"
strSQL = "Insert Into MyDateField Values (CtoD([06/18/2005]))"
--
Cindy Winegarden MCSD, Microsoft Visual Foxpro MVP
cindy_winegarden@xxxxxxx www.cindywinegarden.com
Blog: http://spaces.msn.com/members/cindywinegarden
"Theo" <theo@xxxxxxxxxxxxxx> wrote in message
news:598565574839795@xxxxxxxxxxxxxxxxxxxxx
> When inserting a new record I always seem to get a data type mismatch.
>
> Part of the code is
> ''"&request.form("inspectiontime")&"''
>
> my VFP field is a date..
.
- References:
- inserting a date variable into a foxpro db
- From: Theo
- inserting a date variable into a foxpro db
- Prev by Date: Re: Test Platform for ASP [newbie]
- Next by Date: Re: Test Platform for ASP [newbie]
- Previous by thread: RE: inserting a date variable into a foxpro db
- Next by thread: Test Platform for ASP [newbie]
- Index(es):
Relevant Pages
|