Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL passthrough - return date field
Message
 
To
16/09/2005 10:56:31
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
01050260
Message ID:
01050305
Views:
21
Greg,

MS SQL Server doesn't have a date only field (well, the version due out in November does, I think). So, you'll have to do the second query in VFP to drop the date as you have already considered. Another option would be to bring it over as a character field (yuck) such as:
SELECT left(cast(dateField as varchar(17)), 10) as charDate ...
or something very similar to that. If you just need the data to look like a date, that should work (and Excel might even read it as a date, I don't know). If you need the data as a real date, bring it in as datetime and then get rid of (or ignore) the time portion.

HTH,
Chad


>Greetings,
>
>I'm doing a SQL passthrough to MS SQL Server. I have a date time field in my SQL server that I would like to have come back as a date instead of datetime.
>
>Example: Select invoicedate, customer from invoicedate
>
>Currently I'm getting date time in the invoicedate field so when it dumps to Excel I have extra data I do not need. Of course I can just re-select the data into a cursor to do the conversion in VFP but I would like to know how to convert to a date in a single query.
>
>Thanks in advance!
>
>
>Greg
_________________________________
There are 2 types of people in the world:
    Those who need closure
Previous
Reply
Map
View

Click here to load this message in the networking platform